/* =========================================================
   보드게임 프로젝트 보드 — 화면 스타일
   원칙: 색은 "의미"에만 씁니다.
   · 바탕과 글자는 차분한 회색
   · 진행 단계는 파란색 한 가지의 농담(옅음 = 초반, 진함 = 출시 직전)
   · 초록/노랑/빨강은 정상/주의/지연 상태에만
   색을 바꾸고 싶으면 아래 :root 의 값만 고치면 됩니다.
   ========================================================= */

:root {
  /* 바탕 · 글자 */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --surface-3: #eef0f5;
  --surface-4: #e5e8ee;
  --line: #e3e6ec;
  --line-soft: #eef0f4;
  --line-strong: #cfd3db;
  --text: #151925;
  --text-2: #464d5d;
  --text-3: #666c79;
  --text-4: #9fa5b0;

  /* 대표 색 */
  --accent: #395feb;
  --accent-strong: #314fd7;
  --accent-ink: #2c3ea8;
  --accent-weak: #eef4ff;
  --accent-weak-2: #e0eafe;
  --accent-line: #bcd1fe;
  --focus-ring: rgba(57, 95, 235, 0.2);

  /* 단계 색 (1 = 첫 단계 … 8 = 마지막 단계, 0 = 단계 미지정) */
  --ramp-0: #b9bfca;
  --ramp-1: #94b7f0;
  --ramp-2: #6f9ef8;
  --ramp-3: #5384fa;
  --ramp-4: #416af3;
  --ramp-5: #3851e2;
  --ramp-6: #333dc5;
  --ramp-7: #2d2f9f;
  --ramp-8: #252674;
  --ramp-ink: #1b1e4a;
  /* 단계 색 위에 올라가는 글자 색 */
  --on-ramp-0: #151925;
  --on-ramp-1: #1b1e4a;
  --on-ramp-2: #1b1e4a;
  --on-ramp-3: #1b1e4a;
  --on-ramp-4: #ffffff;
  --on-ramp-5: #ffffff;
  --on-ramp-6: #ffffff;
  --on-ramp-7: #ffffff;
  --on-ramp-8: #ffffff;

  /* 상태 색 */
  --good: #03a14a;
  --good-ink: #016732;
  --good-weak: #e1fae8;
  --warn: #eba002;
  --warn-ink: #824c00;
  --warn-weak: #fff3d6;
  --bad: #e23439;
  --bad-strong: #d42a30;
  --bad-ink: #b71920;
  --bad-weak: #ffebea;
  --muted-ink: #555b68;
  --muted-weak: #eceef3;

  /* 유형 색 */
  --pub-ink: #3144ae;
  --pub-weak: #eaf0fe;
  --teal: #199eaa;
  --teal-ink: #045d69;
  --teal-weak: #daf6fa;

  /* 모양 */
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-card: 0 0 0 1px rgba(21, 25, 37, 0.05), 0 1px 2px rgba(21, 25, 37, 0.04);
  --shadow-raised: 0 0 0 1px rgba(21, 25, 37, 0.07), 0 6px 16px -6px rgba(21, 25, 37, 0.16);
  --shadow-pop: 0 0 0 1px rgba(21, 25, 37, 0.06), 0 18px 44px -12px rgba(21, 25, 37, 0.28), 0 6px 14px -6px rgba(21, 25, 37, 0.1);
  --topbar-h: 60px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666c79' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.3 4.3L18.5 7.8'/%3E%3C/svg%3E");
}

/* ================= 기본 ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-weak-2); }

.ic { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-ic { flex: none; }
.st-ic.good { color: var(--good); }
.st-ic.warn { color: var(--warn); }
.st-ic.bad { color: var(--bad); }
.st-ic.muted { color: #8a909c; }
.st-ic.done { color: var(--muted-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.logo {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border-radius: 30%;
  background: var(--accent);
  background: linear-gradient(140deg, #5384fa 0%, #333dc5 100%);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 1px 2px rgba(40, 38, 87, 0.3);
}

/* ================= 버튼 · 입력 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { background: var(--surface-2); border-color: #bcc1cc; }
.btn:active { background: var(--surface-3); }
.btn .ic { color: var(--text-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(37, 38, 116, 0.22); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.primary .ic, .btn.danger-solid .ic { color: inherit; }
.btn.small { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.btn.danger { border-color: transparent; background: transparent; color: var(--bad-ink); }
.btn.danger .ic { color: inherit; }
.btn.danger:hover { background: var(--bad-weak); }
.btn.danger-solid { background: var(--bad-strong); border-color: var(--bad-strong); color: #fff; }
.btn.danger-solid:hover { background: var(--bad-ink); border-color: var(--bad-ink); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-3);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.del { width: 28px; height: 28px; color: var(--text-4); }
.icon-btn.del:hover { background: var(--bad-weak); color: var(--bad-ink); }

input[type='text'], input[type='search'], input[type='number'], input[type='date'], input:not([type]), select, textarea {
  height: 36px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-4); }
input:hover, select:hover, textarea:hover { border-color: #bcc1cc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text-2); opacity: 1; cursor: default; }
input:disabled:hover, select:disabled:hover, textarea:disabled:hover { border-color: var(--line-strong); }
textarea { display: block; width: 100%; height: auto; min-height: 104px; padding: 9px 11px; line-height: 1.55; resize: vertical; }
select {
  -webkit-appearance: none; appearance: none;
  padding-right: 30px;
  background-image: var(--chev); background-repeat: no-repeat; background-position: right 10px center;
  cursor: pointer;
}
select:disabled { background-image: none; }
input[type='date'] { font-variant-numeric: tabular-nums; }
input[type='date'].is-empty:not(:focus) { color: var(--text-4); }
input[type='date']::-webkit-calendar-picker-indicator { margin-left: 2px; padding: 2px; opacity: 0.4; cursor: pointer; }
input[type='date']:hover::-webkit-calendar-picker-indicator { opacity: 0.75; }
input[type='date']:disabled::-webkit-calendar-picker-indicator { display: none; }
input[type='search']::-webkit-search-cancel-button { cursor: pointer; }

/* 체크박스 */
.chk {
  -webkit-appearance: none; appearance: none;
  display: inline-block; width: 18px; height: 18px; margin: 0; padding: 0; vertical-align: middle;
  border: 1.5px solid #b4bac6; border-radius: 6px; background: var(--surface) center / 14px 14px no-repeat;
  cursor: pointer; transition: background-color 0.12s ease, border-color 0.12s ease;
}
.chk:hover { border-color: var(--accent); }
.chk:checked { background-color: var(--accent); border-color: var(--accent); background-image: var(--check); }
.chk:disabled { cursor: default; opacity: 0.6; }
.chk:focus { box-shadow: none; }
.chk:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 나란히 붙은 선택 버튼 */
.seg { display: inline-flex; flex: none; padding: 3px; border-radius: 10px; background: var(--surface-4); }
.seg button {
  height: 30px; padding: 0 13px; border: 0; border-radius: 7px; background: transparent;
  color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px rgba(21, 25, 37, 0.05), 0 1px 2px rgba(21, 25, 37, 0.1); }

/* 켜고 끄는 스위치 */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 36px; color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; }
.sw-track { position: relative; flex: none; width: 32px; height: 18px; border-radius: 999px; background: #b9bfca; transition: background-color 0.15s ease; }
.sw-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(21, 25, 37, 0.25); transition: transform 0.15s ease; }
.switch input:checked + .sw-track { background: var(--accent); }
.switch input:checked + .sw-track::after { transform: translateX(14px); }
.switch input:focus-visible + .sw-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================= 공통 조각 ================= */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head h3 { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.card-head h3 > .ic { color: var(--text-3); }
.card-body { padding: 12px 20px 18px; }
.hint { color: var(--text-3); font-size: 12.5px; }
.count {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: 0;
}

.badge {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 22px; padding: 0 8px 0 7px; border-radius: 999px;
  font-size: 12px; font-weight: 650; line-height: 1; white-space: nowrap;
}
.badge.good { background: var(--good-weak); color: var(--good-ink); }
.badge.warn { background: var(--warn-weak); color: var(--warn-ink); }
.badge.bad { background: var(--bad-weak); color: var(--bad-ink); }
.badge.muted { background: var(--muted-weak); color: var(--muted-ink); }
.badge.done { background: var(--surface); color: var(--muted-ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge.type-publishing, .badge.type-licensing { padding: 0 7px; border-radius: 6px; }
.badge.type-publishing { background: var(--pub-weak); color: var(--pub-ink); }
.badge.type-licensing { background: var(--teal-weak); color: var(--teal-ink); }

.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ramp-0); }

.dday {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  height: 22px; padding: 0 7px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dday.soon { background: var(--warn-weak); color: var(--warn-ink); }
.dday.overdue { background: var(--bad-weak); color: var(--bad-ink); }

.pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 7px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.pill.bad { background: var(--bad-weak); color: var(--bad-ink); }

/* 진행률 막대: 바탕은 같은 색의 옅은 단계 */
.progress { display: block; flex: 1 1 auto; min-width: 24px; height: 6px; border-radius: 999px; background: var(--accent-weak-2); overflow: hidden; }
.progress > i { display: block; height: 100%; min-width: 0; border-radius: 999px; background: var(--accent); }

.stage-cell { display: inline-flex; align-items: center; gap: 9px; }
.stage-meter { display: inline-flex; flex: none; gap: 2px; }
.stage-meter i { width: 7px; height: 12px; border-radius: 2px; background: var(--surface-4); }
.stage-meter i.on { background: var(--c); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.av-0 { background: #dfe8fe; color: #334889; }
.av-1 { background: #caf0f5; color: #005860; }
.av-2 { background: #f2e0fb; color: #633876; }
.av-3 { background: #f4e6d2; color: #604825; }
.av-4 { background: #d5ebff; color: #005182; }
.av-5 { background: #fedee9; color: #792f50; }
.who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.who > span:last-child { overflow: hidden; text-overflow: ellipsis; }

.empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 30px 12px; color: var(--text-3); font-size: 13px; text-align: center; }
.empty .ic { color: var(--text-4); }

/* 알림 */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 400; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  padding: 10px 16px 10px 13px; border-radius: 11px;
  background: var(--text); color: #fff; font-size: 13.5px; font-weight: 550;
  box-shadow: 0 10px 30px -8px rgba(21, 25, 37, 0.45);
  animation: toast-in 0.18s ease;
}
.toast .ic { color: #7fe0a4; }
.toast.error { background: var(--bad-ink); }
.toast.error .ic { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 말풍선 */
.tip {
  position: fixed; z-index: 500; pointer-events: none; max-width: 300px;
  padding: 8px 11px; border-radius: 9px;
  background: var(--text); color: #fff; font-size: 12px; line-height: 1.5;
  box-shadow: 0 8px 24px -6px rgba(21, 25, 37, 0.4);
}
.tip-title { font-size: 12.5px; font-weight: 650; }
.tip-line { color: rgba(255, 255, 255, 0.74); font-variant-numeric: tabular-nums; }

/* 확인 창 */
.confirm-overlay { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(21, 25, 37, 0.42); animation: fade-in 0.14s ease; }
.confirm { width: min(400px, 100%); padding: 24px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-pop); animation: pop-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.cf-ic { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-weak); color: var(--accent); }
.cf-ic.danger { background: var(--bad-weak); color: var(--bad-strong); }
.confirm h3 { margin-top: 16px; font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }
.confirm p { margin-top: 6px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.cf-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.cf-actions .btn { min-width: 76px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }

/* 처음 불러올 때 */
.boot { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 100vh; color: var(--text-3); font-size: 14px; }
.boot-spin { width: 18px; height: 18px; border: 2px solid var(--accent-weak-2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
.boot.error { color: var(--bad-ink); font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 뼈대 ================= */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  height: var(--topbar-h); padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: 22px; }
.brand-name { font-size: 16px; font-weight: 750; letter-spacing: -0.02em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-2); font-size: 14px; font-weight: 550; white-space: nowrap;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.nav button .ic { color: var(--text-3); }
.nav button:hover { background: var(--surface-3); color: var(--text); }
.nav button.active { background: var(--accent-weak); color: var(--accent-ink); font-weight: 650; }
.nav button.active .ic { color: var(--accent); }
.spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 8px; height: 28px; margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--line); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.user .avatar { width: 28px; height: 28px; font-size: 12.5px; }
.user .nm { font-weight: 550; }
.logout { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; color: var(--text-3); font-size: 12.5px; text-decoration: none; }
.logout:hover { color: var(--text); }

.main { padding: 24px 28px 64px; }
.main.view-dashboard { max-width: 1536px; margin: 0 auto; }
.page-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; min-height: 36px; margin-bottom: 18px; }
.page-title { display: flex; align-items: baseline; gap: 12px; margin-right: auto; }
.page-title h1 { font-size: 22px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.3; white-space: nowrap; }
.page-sub { color: var(--text-3); font-size: 13px; white-space: nowrap; }

.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filters select { min-width: 118px; font-weight: 500; }
.search { display: inline-flex; align-items: center; gap: 7px; width: 220px; height: 36px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); transition: border-color 0.12s ease, box-shadow 0.12s ease; cursor: text; }
.search .ic { color: var(--text-3); }
.search:hover { border-color: #bcc1cc; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.search input:focus { box-shadow: none; }
.filters .switch { margin-left: 6px; }
.view-hint { margin-top: 14px; }

/* ================= 로그인 ================= */
.login {
  position: relative; display: grid; place-items: center; min-height: 100vh; padding: 24px; overflow: hidden;
  background:
    radial-gradient(900px 520px at 12% 8%, #e1e9fe 0%, rgba(225, 233, 254, 0) 62%),
    radial-gradient(820px 520px at 92% 96%, #daf6fa 0%, rgba(218, 246, 250, 0) 60%),
    var(--bg);
}
.login-art { position: absolute; inset: 0; pointer-events: none; }
.lp { position: absolute; display: block; line-height: 0; }
.lp.p1 { left: 9%; bottom: 13%; color: var(--ramp-2); transform: rotate(-14deg); }
.lp.p2 { right: 13%; top: 14%; color: var(--ramp-4); transform: rotate(12deg); }
.lp.p3 { right: 7%; bottom: 9%; color: var(--ramp-1); transform: rotate(8deg); }
.lp.p4 { left: 17%; top: 16%; color: var(--teal); opacity: 0.75; transform: rotate(-8deg); }
.lp.tile { width: 64px; height: 88px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-raised); }
.lp.tile::before { content: ''; position: absolute; inset: 7px; border-radius: 7px; background: var(--accent-weak); }
.lp.tile::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--ramp-2); }
.lp.tile.t1 { left: 23%; bottom: 24%; transform: rotate(16deg); }
.lp.tile.t2 { right: 22%; top: 26%; transform: rotate(-12deg); }
.lp.tile.t2::before { background: var(--teal-weak); }
.lp.tile.t2::after { border-radius: 5px; background: var(--teal); transform: rotate(45deg); }
.lp.die { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 58px; height: 58px; padding: 10px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-raised); }
.lp.die i { align-self: center; justify-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--ramp-7); }
.lp.die.d1 { right: 19%; bottom: 27%; transform: rotate(-12deg); }
.lp.die.d1 i:nth-child(1) { grid-area: 1 / 1; } .lp.die.d1 i:nth-child(2) { grid-area: 1 / 3; }
.lp.die.d1 i:nth-child(3) { grid-area: 2 / 2; } .lp.die.d1 i:nth-child(4) { grid-area: 3 / 1; }
.lp.die.d1 i:nth-child(5) { grid-area: 3 / 3; }
.lp.die.d2 { left: 11%; top: 38%; width: 46px; height: 46px; padding: 8px; border-radius: 12px; transform: rotate(16deg); }
.lp.die.d2 i { width: 7px; height: 7px; }
.lp.die.d2 i:nth-child(1) { grid-area: 1 / 1; } .lp.die.d2 i:nth-child(2) { grid-area: 2 / 2; } .lp.die.d2 i:nth-child(3) { grid-area: 3 / 3; }
.login-card {
  position: relative; width: min(420px, 100%); padding: 40px 36px 24px; border-radius: 22px;
  background: var(--surface); box-shadow: var(--shadow-pop); text-align: center;
}
.login-card h1 { margin-top: 18px; font-size: 22px; font-weight: 750; letter-spacing: -0.025em; }
.login-card p { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.ms-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; margin-top: 26px; border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); color: var(--text); font-size: 14.5px; font-weight: 600; text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.ms-btn:hover { background: var(--surface-2); border-color: #bcc1cc; box-shadow: 0 2px 6px -2px rgba(21, 25, 37, 0.12); }
.login-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12.5px; }

/* ================= 대시보드 ================= */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; min-width: 0; padding: 18px 20px 16px; }
.kpi-head { display: flex; align-items: center; gap: 10px; }
.kpi-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); color: var(--text-2); }
.kpi.alert .kpi-ic { background: var(--bad-weak); color: var(--bad-strong); }
.kpi.warn .kpi-ic { background: var(--warn-weak); color: var(--warn-ink); }
.kpi-label { color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.kpi-label small { margin-left: 4px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.kpi-note { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-note b { color: var(--text); font-weight: 650; }
.kpi-value { margin: 10px 0 10px; font-size: 36px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.kpi-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 24px; margin-top: auto; color: var(--text-3); font-size: 12.5px; }
.split { display: flex; flex: 0 0 100%; gap: 2px; height: 6px; margin-bottom: 2px; }
.split i { min-width: 6px; border-radius: 3px; }
.split i.pub { background: var(--accent); }
.split i.lic { background: var(--teal); }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-2); }
.split-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sw { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 2.5px; }
.sw.pub { background: var(--accent); }
.sw.lic { background: var(--teal); }
.mini-chip {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%;
  height: 24px; padding: 0 9px 0 7px; border: 0; border-radius: 999px;
  background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 600;
  transition: background-color 0.12s ease;
}
.mini-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-chip > em { flex: none; margin-left: 2px; color: var(--text-3); font-style: normal; font-variant-numeric: tabular-nums; }
.mini-chip:hover { background: var(--surface-4); }
.more { color: var(--text-3); font-size: 12px; font-weight: 600; }

/* 단계별 현황 */
.pipe-card { margin-top: 16px; }
.pipe-card .card-body { display: grid; gap: 22px; padding-top: 16px; padding-bottom: 20px; }
.lane { min-width: 0; }
.lane-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lane-desc { color: var(--text-3); font-size: 12.5px; }
.lane-n { margin-left: auto; color: var(--text-3); font-size: 12.5px; font-weight: 550; font-variant-numeric: tabular-nums; }
.track { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); gap: 6px; }
.stop { min-width: 0; }
.stop-bar { display: block; height: 6px; border-radius: 3px; background: var(--c); opacity: 0.32; }
.stop.has .stop-bar { opacity: 1; }
.stop-head { display: flex; align-items: center; gap: 6px; min-height: 20px; margin: 8px 0 6px; }
.stop-name { overflow: hidden; color: var(--text-3); font-size: 12.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.stop.has .stop-name { color: var(--text); font-weight: 650; }
.stop-n { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-weak-2); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tokens { display: flex; flex-direction: column; gap: 4px; }
.token {
  display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0;
  height: 30px; padding: 0 9px; border: 0; border-radius: 8px;
  background: var(--surface-3); color: var(--text); font-size: 12.5px; font-weight: 600; text-align: left;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
.token > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token:hover { background: var(--accent-weak-2); box-shadow: inset 0 0 0 1px var(--accent-line); }

/* 대시보드 아래쪽 카드들 */
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.dash-grid > .card, .stack > .card { min-width: 0; }
.stack { display: grid; gap: 16px; min-width: 0; }
.rows { display: flex; flex-direction: column; margin: 0 -8px; }
.row-item {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 7px 8px; border-radius: 10px; cursor: pointer;
  transition: background-color 0.12s ease;
}
.row-item:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-soft); }
.row-item:focus-visible { outline-offset: -2px; }
.date-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  width: 46px; height: 44px; border-radius: 10px; background: var(--surface-3); line-height: 1.15;
}
.date-tile b { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.date-tile span { margin-top: 2px; color: var(--text-3); font-size: 10.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.date-tile.soon { background: var(--warn-weak); }
.date-tile.soon b, .date-tile.soon span { color: var(--warn-ink); }
.date-tile.overdue { background: var(--bad-weak); }
.date-tile.overdue b, .date-tile.overdue span { color: var(--bad-ink); }
.ri-main { flex: 1; min-width: 0; }
.ri-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tt { overflow: hidden; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.ri-sub { display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 1px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.ri-sub > span { overflow: hidden; text-overflow: ellipsis; }
.ri-sub > .dot, .ri-sub > .sep { flex: none; overflow: visible; }
.ri-sub > .dot { margin-right: 1px; }
.ri-what { color: var(--text-2); }
.sep { color: var(--text-4); }
.group-label { display: flex; align-items: center; gap: 5px; padding: 12px 8px 4px; color: var(--text-3); font-size: 12px; font-weight: 650; }
.group-label:first-child { padding-top: 2px; }
.group-label.bad { color: var(--bad-ink); }

/* 변경 기록 */
.feed-item { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; break-inside: avoid; }
.feed-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); }
.feed-item.add .feed-ic { background: var(--accent-weak-2); color: var(--accent-ink); }
.feed-item.del .feed-ic { background: var(--bad-weak); color: var(--bad-ink); }
.feed-body { flex: 1; min-width: 0; }
.feed-line { font-size: 13px; line-height: 1.5; }
.feed-line b { margin-right: 6px; font-weight: 650; }
.feed-line a { margin-right: 6px; color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.feed-line a:hover { text-decoration: underline; }
.feed-detail { color: var(--text-2); }
.feed-meta { display: flex; gap: 8px; margin-top: 1px; color: var(--text-3); font-size: 12px; }
.feed-meta .when { font-variant-numeric: tabular-nums; }

/* ================= 단계별 보드 ================= */
.board-section + .board-section { margin-top: 26px; }
.board-section h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.board-section h2 small { color: var(--text-3); font-size: 12.5px; font-weight: 400; }
.board-section { transition: opacity 0.15s ease; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); gap: 10px; overflow-x: auto; padding: 1px 1px 6px; margin: -1px; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 132px; padding: 8px; border-radius: 12px; background: #eaedf2; transition: background-color 0.12s ease, box-shadow 0.12s ease; }
.col-head { display: flex; align-items: center; gap: 7px; padding: 3px 4px 2px; }
.col-idx { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 19px; height: 19px; border-radius: 6px; background: var(--c); color: var(--ci, #fff); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.col-name { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.col-head .n { margin-left: auto; color: var(--text-3); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.col.drop { background: var(--accent-weak-2); box-shadow: inset 0 0 0 2px var(--accent); }
#view[data-drag-type='publishing'] .board-section[data-type='licensing'],
#view[data-drag-type='licensing'] .board-section[data-type='publishing'] { opacity: 0.4; }

.pcard {
  container-type: inline-size;
  position: relative; padding: 11px 11px 10px; border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow-card); cursor: pointer;
  transition: box-shadow 0.12s ease, transform 0.12s ease, opacity 0.12s ease;
}
.pcard[draggable='true'] { cursor: grab; }
.pcard[draggable='true']:active { cursor: grabbing; }
.pcard:hover { box-shadow: var(--shadow-raised); transform: translateY(-1px); }
.pcard.dragging { opacity: 0.4; transform: none; }
.pcard .t { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.35; }
.pcard .t small { display: block; overflow: hidden; margin-top: 1px; color: var(--text-3); font-size: 11.5px; font-weight: 400; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.pcard .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
.pcard .rel { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pcard .rel .ic { color: var(--text-3); }
.pcard .rel .d { margin-left: auto; padding-left: 6px; color: var(--text-3); font-weight: 600; }
@container (max-width: 148px) { .rel-k { display: none; } }
.pcard .next { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin-top: 7px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-soft); font-size: 12px; line-height: 1.45; }
.pcard .next .k { flex: none; color: var(--text-3); font-size: 11px; font-weight: 650; }
.pcard .next .v { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pcard .next .d { flex: 0 0 100%; color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pcard .next.overdue { background: var(--bad-weak); box-shadow: none; }
.pcard .next.overdue .k, .pcard .next.overdue .d { color: var(--bad-ink); }
.pcard .next.overdue .d { font-weight: 600; }
.pcard .next.lic { align-items: center; gap: 5px; background: var(--warn-weak); color: var(--warn-ink); }
.pcard .next.lic .ic { align-self: center; }
.pcard .prog { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pcard .prog > span:last-child { flex: none; min-width: 30px; color: var(--text-3); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }

/* ================= 간트차트 ================= */
.gantt-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-left: auto; color: var(--text-3); font-size: 12px; }
.legend > span { display: inline-flex; align-items: center; white-space: nowrap; }
.lg-ramp { display: inline-flex; gap: 1px; margin-right: 7px; }
.lg-ramp i { width: 9px; height: 10px; }
.lg-ramp i:first-child { border-radius: 3px 0 0 3px; }
.lg-ramp i:last-child { border-radius: 0 3px 3px 0; }
.lg-sw { display: inline-block; width: 16px; height: 10px; margin-right: 6px; border-radius: 3px; }
.lg-sw.done { background: #cfd4dd; }
.lg-sw.overdue { background: var(--ramp-3); box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--bad); margin-left: 3px; margin-right: 9px; }
.lg-mark { display: inline-block; width: 9px; height: 9px; margin: 0 8px 0 2px; border-radius: 2px; transform: rotate(45deg); }
.lg-mark.release { background: var(--good); }
.lg-mark.license { background: var(--bad); }

.gantt { --gl: 280px; position: relative; overflow: auto; max-height: calc(100vh - 236px); min-height: 220px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.g-inner { width: max-content; min-width: 100%; }
.g-row { display: flex; }
.g-label {
  position: sticky; left: 0; z-index: 4;
  display: flex; align-items: center; gap: 6px; flex: 0 0 var(--gl); width: var(--gl); min-width: 0;
  padding: 0 14px 0 10px; background: var(--surface); border-right: 1px solid var(--line);
}
.g-track { position: relative; flex: none; }
.g-head { position: sticky; top: 0; z-index: 6; display: flex; background: var(--surface); box-shadow: 0 1px 0 var(--line), 0 4px 8px -6px rgba(21, 25, 37, 0.12); }
.g-head .g-label { z-index: 5; padding-left: 16px; color: var(--text-3); font-size: 12px; font-weight: 650; }
/* 고정된 이름 칸 밑으로 지나가는 머리글이 뚝 잘리지 않고 옅어지며 사라집니다 */
.g-head .g-label::after { content: ''; position: absolute; top: 0; bottom: 0; left: calc(100% + 1px); width: 10px; background: linear-gradient(90deg, var(--surface) 30%, transparent); pointer-events: none; }
.g-head-tracks { flex: none; }
.g-head .g-track { display: block; }
.g-track.h1 { height: 30px; }
.g-track.h2 { height: 26px; }
.g-cell { position: absolute; top: 0; bottom: 0; overflow: hidden; white-space: nowrap; }
.g-cell.t1 { border-left: 1px solid var(--line-strong); color: var(--text); font-size: 12.5px; font-weight: 700; line-height: 30px; overflow: visible; }
.g-cell.t1 > span { position: sticky; left: calc(var(--gl) + 1px); display: inline-block; padding: 0 10px; }
.g-cell.t2 { padding-left: 10px; border-left: 1px solid var(--line); color: var(--text-3); font-size: 11.5px; font-weight: 500; line-height: 24px; font-variant-numeric: tabular-nums; overflow: clip; }
/* 달·주 이름은 칸이 일부만 보여도 왼쪽 끝에 붙어서 끝까지 읽힙니다 */
.g-cell.t2 > span { position: sticky; left: calc(var(--gl) + 8px); z-index: 4; display: inline-block; margin-left: -3px; padding: 0 3px; background: var(--surface); line-height: 18px; vertical-align: middle; }
.g-today-h {
  position: absolute; top: 6px; z-index: 2; transform: translateX(-50%);
  height: 18px; padding: 0 7px; border-radius: 999px;
  background: var(--text); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; white-space: nowrap;
}
.g-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); pointer-events: none; }
.g-grid.yr { background: var(--line-strong); }
.g-grid.wk { background: #f4f5f8; }
.g-now { position: absolute; top: 0; bottom: 0; z-index: 3; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.82; pointer-events: none; }
.g-track.h2 .g-now { top: -6px; }

.g-row.project { height: 42px; border-top: 1px solid var(--line); }
.g-head + .g-row.project { border-top-color: transparent; }
.g-row.project .g-label { cursor: pointer; transition: background-color 0.12s ease; }
.g-row.project .g-label:hover { background: var(--surface-2); }
.g-row.project .g-label:focus-visible { outline-offset: -2px; }
.g-row.project:hover > .g-track { background: #fafbfe; }
.g-row.ms:hover > .g-track, .g-row.ms:hover > .g-label { background: #f3f5fa; }
.caret { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; color: var(--text-3); transition: transform 0.15s ease; }
.g-row.open .caret { transform: rotate(90deg); }
.g-label .nm { overflow: hidden; font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
.g-stage { display: inline-flex; align-items: center; gap: 5px; flex: none; margin-left: auto; padding-left: 6px; color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.g-sum { position: absolute; top: 50%; z-index: 1; height: 12px; margin-top: -6px; border-radius: 6px; background: var(--accent-weak-2); cursor: pointer; transition: box-shadow 0.12s ease; }
.g-sum:hover { box-shadow: 0 0 0 4px var(--focus-ring); }
.g-fill { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.g-seg { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--rc, var(--ramp-0)); box-shadow: 0 0 0 1px var(--surface); pointer-events: none; }
.g-seg.done { background: #cfd4dd; }
.g-seg.overdue { z-index: 1; box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3.5px var(--bad); }
.s1 { --rc: var(--ramp-1); --ri: var(--on-ramp-1); }
.s2 { --rc: var(--ramp-2); --ri: var(--on-ramp-2); }
.s3 { --rc: var(--ramp-3); --ri: var(--on-ramp-3); }
.s4 { --rc: var(--ramp-4); --ri: var(--on-ramp-4); }
.s5 { --rc: var(--ramp-5); --ri: var(--on-ramp-5); }
.s6 { --rc: var(--ramp-6); --ri: var(--on-ramp-6); }
.s7 { --rc: var(--ramp-7); --ri: var(--on-ramp-7); }
.s8 { --rc: var(--ramp-8); --ri: var(--on-ramp-8); }
.g-mark { position: absolute; top: 50%; z-index: 2; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 3px; box-shadow: 0 0 0 2px var(--surface); transform: rotate(45deg); }
.g-mark.release { background: var(--good); }
.g-mark.license { background: var(--bad); }

.g-row.ms { height: 32px; }
.g-row.ms .g-label, .g-row.ms .g-track { background: var(--surface-2); }
.g-row.ms .g-label { padding-left: 34px; color: var(--text-2); }
.g-row.ms .g-label .nm { font-size: 12.5px; font-weight: 500; letter-spacing: 0; }
.g-row.ms.done .g-label .nm { color: var(--text-3); }
.g-row.ms.overdue .g-label .nm { color: var(--bad-ink); font-weight: 600; }
.ms-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 14px; height: 14px; color: var(--text-3); }
.g-dates { flex: none; margin-left: auto; padding-left: 6px; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.g-bar {
  position: absolute; top: 6px; z-index: 1; height: 20px; padding: 0 8px; border-radius: 5px;
  background: var(--rc, var(--ramp-0)); color: var(--ri, var(--on-ramp-0));
  font-size: 11.5px; font-weight: 600; line-height: 20px; white-space: nowrap; overflow: hidden; overflow: clip; cursor: pointer;
}
/* 막대가 화면 왼쪽으로 넘어가도 이름은 보이는 쪽에 붙어 있습니다 */
.g-bar > span { position: sticky; left: calc(var(--gl) + 8px); display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.g-bar.done { background: #cfd4dd; color: var(--text-2); }
.g-bar.overdue { box-shadow: 0 0 0 1.5px var(--surface-2), 0 0 0 3.5px var(--bad); }
.g-bar:hover { filter: brightness(1.06); }
.g-bar:focus-visible { outline-offset: 3px; }
/* 막대 밖 이름표: 줄 바탕색을 그대로 깔아 오늘 선·눈금선이 글자를 가로지르지 않게 합니다 */
.g-out { position: absolute; top: 6px; z-index: 3; margin-left: -4px; padding: 0 4px; border-radius: 4px; background: inherit; color: var(--text-2); font-size: 11.5px; font-weight: 500; line-height: 20px; white-space: nowrap; pointer-events: none; }
.g-row.ms.done .g-out { color: var(--text-3); }
.g-bar.overdue + .g-out { margin-left: 1px; }
.empty-card { padding: 36px 20px; }

/* ================= 전체 목록 ================= */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid th {
  padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  color: var(--text-3); font-size: 12px; font-weight: 650; text-align: left; white-space: nowrap; cursor: pointer; user-select: none;
}
table.grid th:first-child, table.grid td:first-child { padding-left: 20px; }
table.grid th:last-child, table.grid td:last-child { padding-right: 20px; }
table.grid th > span { display: inline-flex; align-items: center; gap: 3px; }
table.grid th:hover, table.grid th.sorted { color: var(--text); }
table.grid th.sorted .ic { color: var(--accent); stroke-width: 2.6; }
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); color: var(--text); white-space: nowrap; vertical-align: middle; }
table.grid tbody tr:last-child td { border-bottom: 0; }
table.grid tbody tr { cursor: pointer; transition: background-color 0.1s ease; }
table.grid tbody tr:hover { background: var(--surface-2); }
table.grid tbody tr:focus-visible { outline-offset: -2px; }
table.grid td.c-title b { display: block; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
table.grid td.c-title .en { display: block; color: var(--text-3); font-size: 12px; }
table.grid td.muted { color: var(--text-3); }
table.grid td.num { color: var(--text-2); font-variant-numeric: tabular-nums; }
table.grid td.num.warn { color: var(--warn-ink); font-weight: 650; }
table.grid td.num.bad { color: var(--bad-ink); font-weight: 650; }
.sub-d { margin-left: 8px; color: var(--text-3); font-size: 12px; }
.prog-cell { display: inline-flex; align-items: center; gap: 8px; }
.prog-cell .progress { flex: none; width: 64px; }
.prog-cell > span:last-child { min-width: 34px; font-weight: 600; text-align: right; }
table.grid tr.none, table.grid tr.none:hover { background: none; cursor: default; }
table.grid tr.none td { padding: 12px; }

/* ================= 상세 화면 ================= */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; background: rgba(21, 25, 37, 0.4); }
.overlay.enter { animation: fade-in 0.18s ease; }
.overlay.enter .drawer { animation: drawer-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.drawer { display: flex; flex-direction: column; width: min(1080px, 100vw); height: 100%; background: var(--surface); box-shadow: -20px 0 50px -16px rgba(21, 25, 37, 0.3); }
.drawer-head { flex: none; padding: 16px 28px 0; border-bottom: 1px solid var(--line); }
.dh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dh-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dh-top .icon-btn { margin-right: -6px; }
.drawer-head h2 { margin-top: 8px; font-size: 24px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.3; }
.drawer-head h2 small { margin-left: 10px; color: var(--text-3); font-size: 14px; font-weight: 450; letter-spacing: 0; }
.dh-hint { margin: 6px 0 18px; color: var(--text-3); font-size: 13.5px; }
.stepper { display: flex; gap: 4px; margin-top: 16px; }
.stepper li { flex: 1; min-width: 0; }
.s-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-4); }
.stepper li.past .s-bar, .stepper li.current .s-bar { background: var(--c); }
.s-label { display: block; overflow: hidden; margin-top: 6px; color: var(--text-3); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.stepper li.past .s-label { color: var(--text-2); }
.stepper li.current .s-label { color: var(--text); font-weight: 700; }
.dh-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; }
.dh-meta .m { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dh-meta .m > .ic { color: var(--text-3); }
.dh-meta .m .progress { flex: none; width: 84px; }
.dh-meta .m .dday { margin-left: 2px; }
.dh-meta .m.dim { color: var(--text-3); }
.tabs { display: flex; gap: 2px; margin: 14px -12px 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 42px; padding: 0 12px; border: 0; background: transparent;
  color: var(--text-3); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: color 0.12s ease;
}
.tabs button::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent-ink); }
.tabs button.active::after { background: var(--accent); }
.tabs button:focus-visible { outline-offset: -3px; border-radius: 8px; }
.tabs .cnt { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tabs button.active .cnt { background: var(--accent-weak-2); color: var(--accent-ink); }
.drawer-body { flex: 1; min-height: 0; overflow: auto; padding: 22px 28px 32px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.drawer-foot { display: flex; align-items: center; gap: 8px; flex: none; min-height: 64px; padding: 12px 28px; border-top: 1px solid var(--line); background: var(--surface); }
.drawer-foot .left { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 0; color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.drawer-foot .btn { min-width: 72px; }
.drawer-foot .btn.danger { margin-left: -8px; }

/* 기본 정보 입력 */
.fsec + .fsec { margin-top: 26px; }
.fsec h4 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--text); font-size: 14px; font-weight: 700; }
.fsec h4::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.field.full { grid-column: 1 / -1; }
.field input, .field select { width: 100%; height: 38px; }
.req { margin-left: 2px; color: var(--bad); font-style: normal; font-weight: 700; }
.callout { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 12px 14px; border-radius: 11px; background: var(--accent-weak); color: var(--text-2); font-size: 13px; line-height: 1.6; }
.callout > .ic { margin-top: 2px; color: var(--accent); }
.callout b { color: var(--text); font-weight: 650; }

/* 바로 고치는 표 */
table.itable { width: 100%; min-width: 760px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.itable.quotes { min-width: 960px; }
table.itable.prod { min-width: 600px; }
table.itable th { padding: 0 9px 8px; border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 12px; font-weight: 650; text-align: left; white-space: nowrap; }
table.itable th.r { text-align: right; }
table.itable td { padding: 4px 1px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.itable tbody tr:last-child td { border-bottom: 0; }
table.itable td > input:not(.chk), table.itable td select, table.itable .with-dot select {
  width: 100%; height: 32px; padding: 0 8px; border-color: transparent; border-radius: 7px; background-color: transparent; font-size: 13px;
}
table.itable td select { padding-right: 24px; background-position: right 7px center; }
table.itable tbody tr:hover td > input:not(.chk):not(:focus):not(:disabled),
table.itable tbody tr:hover td select:not(:focus):not(:disabled) { border-color: var(--line); background-color: var(--surface); }
table.itable td > input:not(.chk):not(:disabled):hover:not(:focus), table.itable td select:not(:disabled):hover:not(:focus) { border-color: var(--line-strong) !important; }
table.itable td > input:not(.chk):focus, table.itable td select:focus { border-color: var(--accent); background-color: var(--surface); }
table.itable input:disabled, table.itable select:disabled { background-color: transparent; color: var(--text); }
table.itable input[type='date'] { min-width: 126px; padding-right: 4px; }
table.itable input[type='number'] { -moz-appearance: textfield; appearance: textfield; text-align: right; font-variant-numeric: tabular-nums; }
table.itable input[type='number']::-webkit-inner-spin-button, table.itable input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
table.itable .ttl { font-weight: 600; }
table.itable .wide { min-width: 110px; }
table.itable th.c-chk, table.itable td.c-chk { width: 46px; padding-left: 0; padding-right: 0; text-align: center; }
table.itable th.c-del, table.itable td.c-del { width: 34px; text-align: right; }
table.itable td.c-del .icon-btn { color: #8a909c; }
table.itable td.c-del .icon-btn:hover { color: var(--bad-ink); }
.with-dot { display: flex; align-items: center; gap: 2px; padding-left: 8px; }
.with-dot .dot { flex: none; }
table.itable tr.is-done .ttl { color: var(--text-3); }
table.itable tr.is-overdue .due { color: var(--bad-ink); font-weight: 650; background-color: var(--bad-weak) !important; }
table.itable tr.none td { padding: 0; }
.tone-select { font-weight: 650; }
.tone-select[data-v='pending'] { background-color: var(--muted-weak) !important; color: var(--muted-ink); }
.tone-select[data-v='revise'] { background-color: var(--warn-weak) !important; color: var(--warn-ink); }
.tone-select[data-v='approved'] { background-color: var(--good-weak) !important; color: var(--good-ink); }
.section-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.section-actions .grow { flex: 1; }
.inline-field { display: inline-flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.inline-field input { height: 30px; padding: 0 6px 0 9px; border-radius: 8px; font-size: 13px; }
.tab-hint { margin-top: 14px; }

/* 견적 비교 */
table.itable td.price { position: relative; }
.best-tag { display: none; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--good-weak); color: var(--good-ink); font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.best-tag.static { display: inline-flex; margin: 0 1px; vertical-align: 1px; }
td.price .best-tag { position: absolute; left: 7px; top: 50%; z-index: 1; transform: translateY(-50%); pointer-events: none; }
tr.best td.price .best-tag { display: inline-flex; }
tr.best td.price input { color: var(--good-ink); font-weight: 700; }
table.itable td.total { padding-right: 9px; color: var(--text); font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.itable tr.picked td { background: var(--accent-weak); }
table.itable tr.picked td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.itable tr.picked .ttl { color: var(--accent-ink); }

/* 생산 관리 */
.prod-track { display: flex; gap: 4px; margin-bottom: 20px; }
.prod-track li { flex: 1; min-width: 0; }
.pt-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-4); }
.prod-track li.done .pt-bar { background: var(--accent); }
.prod-track li.late .pt-bar { background: var(--bad); }
.pt-name { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--text-3); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.prod-track li.done .pt-name, .prod-track li.now .pt-name, .prod-track li.late .pt-name { color: var(--text); }
.prod-track li.now .pt-name { font-weight: 700; }
.pt-cap { display: block; margin-top: 2px; padding-left: 24px; color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-track li.late .pt-cap { color: var(--bad-ink); font-weight: 600; }
.step-ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; border-radius: 50%; }
.step-ic.todo { box-shadow: inset 0 0 0 1.5px #b4bac6; }
.step-ic.done { background: var(--accent); color: #fff; }
.step-ic.done .ic { stroke-width: 2.8; }
.step-ic.late { background: var(--bad-weak); color: var(--bad-ink); }
.prod-track li.now .step-ic.todo { box-shadow: inset 0 0 0 2px var(--accent); }
table.itable.prod td b { padding-left: 9px; font-weight: 650; }
table.itable td.st-cell { line-height: 0; }

/* ================= 화면이 좁을 때 ================= */
@media (max-width: 1240px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stack { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .stack > .card:last-child { grid-column: 1 / -1; }
  .stack > .card:last-child .feed { columns: 2; column-gap: 40px; column-rule: 1px solid var(--line); }
  .legend { margin-left: 0; flex-basis: 100%; }
}

@media (max-width: 1020px) {
  .topbar { padding: 0 16px; }
  .brand { margin-right: 8px; }
  .brand-name { display: none; }
  .btn .lbl { display: none; }
  .user .nm { display: none; }
  .main { padding: 20px 16px 64px; }
  .track { grid-template-columns: 1fr; gap: 2px; }
  .stop { display: grid; grid-template-columns: 4px minmax(0, 112px) minmax(0, 1fr); align-items: center; gap: 0 10px; min-height: 34px; }
  .stop-bar { width: 4px; height: 100%; min-height: 26px; border-radius: 2px; }
  .stop-head { margin: 0; }
  .tokens { flex-direction: row; flex-wrap: wrap; padding: 2px 0; }
  .token { width: auto; max-width: 100%; }
}

@media (max-width: 720px) {
  body { font-size: 14px; }
  .topbar { gap: 6px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .nav button { flex-direction: column; justify-content: center; gap: 3px; height: 48px; padding: 0 4px; font-size: 11px; font-weight: 600; }
  .user { margin-left: 2px; padding-left: 10px; }
  .logout span { display: none; }
  .main { padding: 16px 14px 96px; }
  .page-head { margin-bottom: 14px; }
  .page-title { flex-direction: column; gap: 0; }
  .page-title h1 { font-size: 20px; }
  .filters { width: 100%; }
  .filters .seg { display: flex; flex: 1 1 100%; }
  .filters .seg button { flex: 1; }
  .filters select { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .search { flex: 1 1 150px; width: auto; }
  .filters .switch { margin-left: 2px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px 14px 12px; }
  .kpi-value { font-size: 30px; }
  .kpi-label { font-size: 12.5px; }
  .pipe-card, .dash-grid { margin-top: 10px; }
  .dash-grid, .stack { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .card-head { padding: 14px 16px 0; }
  .card-head .hint { display: none; }
  .card-body { padding: 10px 16px 14px; }
  .stack > .card:last-child .feed { columns: 1; }
  .board { grid-auto-columns: minmax(220px, 78vw); scroll-snap-type: x proximity; }
  .col { scroll-snap-align: start; }
  .board-section h2 small { display: none; }
  .gantt { --gl: 148px; max-height: calc(100vh - 300px); }
  .g-stage, .g-dates { display: none; }
  .g-row.ms .g-label { padding-left: 26px; }
  .gantt-toolbar .btn.small { padding: 0 8px; }
  .drawer { width: 100vw; }
  .drawer-head { padding: 12px 16px 0; }
  .drawer-head h2 { font-size: 20px; }
  .drawer-head h2 small { display: block; margin: 2px 0 0; font-size: 13px; }
  .s-label { display: none; }
  .stepper li.current .s-label { display: block; overflow: visible; }
  .tabs { margin: 12px -10px 0; }
  .drawer-body { padding: 16px 16px 24px; }
  .drawer-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .fgrid { grid-template-columns: minmax(0, 1fr); }
  .drawer-body .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .prod-track { flex-wrap: wrap; gap: 10px 4px; }
  .prod-track li { flex: 1 1 30%; }
  .toast { bottom: 84px; }
  .lp.tile, .lp.die { display: none; }
  .login-card { padding: 32px 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .topbar, .filters, .gantt-toolbar .btn, .seg, .view-hint, .toast { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; }
  .card { box-shadow: 0 0 0 1px var(--line); break-inside: avoid; }
  .gantt { max-height: none; overflow: visible; }
}
