:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e7e9ee;
  --line2: #f0f1f4;
  --text: #191f28;
  --sub: #4e5968;
  --muted: #8b95a1;
  --brand: #5b4cf0;
  --brand-soft: #efedff;
  --green: #12b76a;
  --green-soft: #e7f8ef;
  --amber: #f59e0b;
  --amber-soft: #fff5e0;
  --red: #f04452;
  --red-soft: #ffecee;
  --blue: #3182f6;
  --blue-soft: #e8f3ff;
  --gray-soft: #f2f4f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
[hidden] { display: none !important; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.btn:hover { background: var(--gray-soft); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #4a3bdf; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; width: 100%; }
.btn-ghost { border-color: transparent; background: transparent; }
.icon-btn { width: 36px; padding: 0; }

/* 로그인 */
.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% -10%, #e9e6ff 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e0f2ff 0%, transparent 60%), var(--bg); }
.login-card { width: min(400px, 92vw); background: var(--panel); border-radius: 20px; padding: 40px 32px 28px; box-shadow: var(--shadow-lg); text-align: center; }
.login-card h1 { margin: 18px 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.login-card .btn { margin-top: 24px; }
.login-card .tiny { margin-top: 14px; }
.login-err { margin-top: 18px; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 600; font-size: 13px; }
.brand-mark { width: 52px; height: 52px; margin: 0 auto; border-radius: 14px; display: grid; place-items: center; font-weight: 800; color: #fff; letter-spacing: -0.04em; background: linear-gradient(135deg, #7b6cff, #5b4cf0 55%, #3182f6); }

/* 상단 */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .brand-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; margin: 0; }
.topbar .title { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.topbar .title small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.topbar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; color: var(--sub); font-size: 13px; }
.fetched { color: var(--muted); font-size: 12px; }

.wrap { padding: 20px 24px 60px; max-width: 1680px; margin: 0 auto; }

/* 직군 탭 */
.tracks { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.track-tab { height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.track-tab .n { font-size: 12px; color: var(--muted); font-weight: 600; }
.track-tab[aria-pressed='true'] { background: var(--text); color: #fff; border-color: var(--text); }
.track-tab[aria-pressed='true'] .n { color: rgba(255, 255, 255, 0.7); }

/* 퍼널 */
.funnel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.metric { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.metric .label { color: var(--sub); font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.metric .value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
.metric .value small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.metric .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* 도구줄 */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { height: 30px; padding: 0 12px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--sub); }
.seg button[aria-pressed='true'] { background: var(--text); color: #fff; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); padding: 0 12px 0 36px; font: inherit; background: var(--panel); outline: none; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.chk { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--sub); user-select: none; }
.chk input { accent-color: var(--brand); }
.toolbar .spacer { flex: 1; }

/* 칸반 */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: #eef0f4; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; }
.col-head .count { margin-left: auto; font-size: 12px; color: var(--sub); background: var(--panel); border-radius: 999px; padding: 1px 9px; font-weight: 700; }
.col-body { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 330px); overflow-y: auto; padding: 2px; }
.col-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 18px 0; }
.card { background: var(--panel); border-radius: 12px; padding: 12px; border: 1px solid transparent; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; text-align: left; width: 100%; }
.card:hover { border-color: #d5d0ff; box-shadow: 0 4px 14px rgba(91, 76, 240, 0.12); transform: translateY(-1px); }
.card-top { display: flex; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 13px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.card-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.card-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 11px; color: var(--muted); }

/* 배지 */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--gray-soft); color: var(--sub); white-space: nowrap; }
.b-brand { background: var(--brand-soft); color: var(--brand); }
.b-green { background: var(--green-soft); color: #0a8f52; }
.b-amber { background: var(--amber-soft); color: #b46b00; }
.b-red { background: var(--red-soft); color: var(--red); }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.t-기획 { background: #fff0f6; color: #d6336c; }
.t-개발 { background: var(--blue-soft); color: var(--blue); }
.t-아트 { background: #fff4e6; color: #e8590c; }
.t-기타 { background: var(--gray-soft); color: var(--sub); }

/* 리스트 */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 980px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line2); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; cursor: pointer; user-select: none; }
th[data-sort]::after { content: ''; }
th.sorted-desc::after { content: ' ↓'; }
th.sorted-asc::after { content: ' ↑'; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #faf9ff; }
td .who { display: flex; align-items: center; gap: 10px; }
td .who .avatar { width: 28px; height: 28px; font-size: 11px; }
.link { color: var(--brand); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* 상세 패널 */
.scrim { position: fixed; inset: 0; background: rgba(15, 20, 30, 0.32); z-index: 40; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--panel); z-index: 50; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: flex-start; }
.drawer-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-head .contact { margin-top: 6px; color: var(--sub); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.drawer-head .contact a { text-decoration: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 40px; }
.sec { padding: 18px 0; border-bottom: 1px solid var(--line2); }
.sec:last-child { border-bottom: 0; }
.sec h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 0.02em; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.step { border-radius: 10px; padding: 10px; background: var(--gray-soft); text-align: center; }
.step .k { font-size: 11px; color: var(--muted); font-weight: 600; }
.step .v { font-weight: 700; margin-top: 2px; font-size: 13px; }
.step.pass { background: var(--green-soft); } .step.pass .v { color: #0a8f52; }
.step.fail { background: var(--red-soft); } .step.fail .v { color: var(--red); }
.step.wait { background: var(--amber-soft); } .step.wait .v { color: #b46b00; }
.assign { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; gap: 12px; align-items: center; }
.assign.ok { border-color: #b7ebd0; background: #f5fcf8; }
.assign .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 18px; background: var(--gray-soft); }
.assign.ok .ico { background: var(--green-soft); }
.assign .grow { flex: 1; min-width: 0; }
.assign .t { font-weight: 700; }
.assign .s { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 8px 12px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; }
.career { display: flex; flex-direction: column; gap: 10px; }
.career-item { border-left: 3px solid var(--brand-soft); padding: 2px 0 2px 12px; }
.career-item .c { font-weight: 700; }
.career-item .r { color: var(--sub); font-size: 13px; }
.career-item .p { color: var(--muted); font-size: 12px; }
.career-item details { margin-top: 4px; }
.career-item summary { cursor: pointer; color: var(--brand); font-size: 12px; font-weight: 600; }
.pre { white-space: pre-wrap; word-break: break-word; color: var(--sub); font-size: 13px; line-height: 1.7; }
.letter { background: #fafbfc; border: 1px solid var(--line2); border-radius: 12px; padding: 14px 16px; max-height: 420px; overflow: auto; }
.links { display: flex; flex-direction: column; gap: 6px; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.link-row:hover { border-color: #d5d0ff; background: #faf9ff; }
.link-row .host { font-weight: 700; font-size: 13px; }
.link-row .url { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row .grow { min-width: 0; flex: 1; }
.note { background: var(--amber-soft); border-radius: 10px; padding: 12px 14px; }

.notice { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); color: #8a5300; margin-bottom: 14px; font-weight: 600; }
.loading { display: grid; place-items: center; height: 50vh; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .topbar .title small, .fetched, .me .name { display: none; }
  .wrap { padding: 14px 12px 40px; }
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-auto-columns: 82vw; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
}
