:root {
  --ink: #0a0a0a;
  --ink-2: #3d3d3d;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --line-2: #f0f0f0;
  --bg: #ffffff;
  --bg-soft: #f7f7f7;
  --warn: #b45309;
  --warn-bg: #fff8eb;
  --bad: #c0392b;
  --radius: 14px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--font); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .4; cursor: not-allowed; border-color: var(--line); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2a2a; }
.btn.ghost { border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-soft); border-color: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.danger:hover { color: var(--bad); }
.btn.wide { width: 100%; height: 48px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── 로그인 ── */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--ink);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--bg); border-radius: 20px;
  padding: 40px 32px 32px; display: flex; flex-direction: column; gap: 14px;
}
.login-card h1 { font-size: 24px; letter-spacing: -0.03em; }
.login-error { color: var(--bad); font-size: 13px; min-height: 1em; }
.demo-note { background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.brand { font-weight: 800; letter-spacing: 0.02em; text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand span { font-weight: 500; color: var(--muted); font-size: 13px; letter-spacing: -0.01em; }
.brand.big { font-size: 30px; margin-bottom: 8px; }

/* ── 틀 ── */
.topbar {
  position: sticky; top: 0; z-index: 10; height: 60px; padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
  background: var(--ink); color: #fff;
}
.topbar .brand { font-size: 18px; color: #fff; }
.topbar .brand span { color: #9a9a9a; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  text-decoration: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: #b5b5b5;
}
.topbar nav a:hover { color: #fff; }
.topbar nav a.active { background: #fff; color: var(--ink); }
.spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 6px; }
.user-name { font-weight: 600; font-size: 14px; }
.topbar .btn.ghost { color: #b5b5b5; background: transparent; }
.topbar .btn.ghost:hover { background: #222; color: #fff; }
.save-status { font-size: 12.5px; color: #9a9a9a; }
.save-status.error { color: #ff9b8f; }
.demo-bar { background: var(--bg-soft); border-bottom: 1px solid var(--line); text-align: center; font-size: 12.5px; color: var(--ink-2); padding: 6px 16px; }
.page { max-width: 1120px; margin: 0 auto; padding: 40px 24px 96px; }

.hero { margin-bottom: 28px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); }
.hero h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.04em; margin: 4px 0 20px; }
.back { display: inline-block; margin-bottom: 16px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--ink); }
.person {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 4px 20px;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); padding: 14px 0;
}

/* ── 입력 ── */
.label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.hint { font-weight: 400; color: #b0b0b0; }
.cell { min-width: 0; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 6px 0; min-height: 34px; }
.text.empty { color: #c4c4c4; }
.text.num, .field.num { font-variant-numeric: tabular-nums; }
.field {
  display: block; width: 100%; min-height: 34px; padding: 6px 10px; margin: 0 -10px;
  width: calc(100% + 20px);
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  resize: none; overflow: hidden; line-height: 1.5;
  transition: background .12s, border-color .12s;
}
.field:hover { background: var(--bg-soft); }
.field:focus { background: var(--bg); border-color: var(--ink); outline: none; }
.field::placeholder { color: #c4c4c4; }
.field.invalid { border-color: var(--bad); }
select.field { appearance: none; cursor: pointer; padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, #999 50%), linear-gradient(135deg, #999 50%, transparent 50%);
  background-position: calc(100% - 12px) 15px, calc(100% - 8px) 15px; background-size: 4px 4px; background-repeat: no-repeat; }
.suffix { display: flex; align-items: center; gap: 2px; }
.suffix .field { width: 64px; margin-right: 0; text-align: right; }
.suffix span { color: var(--muted); }
.center { text-align: center; }

/* ── 안내 ── */
.notice {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  background: var(--ink); color: #fff; border-radius: var(--radius); padding: 22px 26px; margin-bottom: 16px;
}
.notice .label { color: #9a9a9a; }
.notice-now p { font-size: 16px; font-weight: 500; }
.notice-now p.muted { font-size: 12.5px; font-weight: 400; color: #9a9a9a; margin-top: 4px; }
.steps { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; }
.steps li { display: flex; flex-direction: column; padding: 8px 16px; border-radius: 10px; border: 1px solid #333; color: #8a8a8a; min-width: 92px; }
.steps li.on { background: #fff; border-color: #fff; color: var(--ink); }
.steps li.done { color: #d0d0d0; }
.step-month { font-size: 12px; font-weight: 600; }
.step-title { font-weight: 700; font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.card.warn { border-color: var(--warn); background: var(--warn-bg); }
.card-main { display: flex; align-items: baseline; gap: 6px; margin: 2px 0; }
.big-num { font-size: 32px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.unit { color: var(--muted); font-weight: 500; }
.card-main .badge { margin-left: auto; align-self: center; }
.dist { display: flex; gap: 12px; margin: 8px 0 6px; }
.dist > span { display: flex; align-items: center; gap: 6px; }
.summary { margin-bottom: 32px; }
.alerts { list-style: none; margin: 12px 0 0; padding: 14px 18px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-size: 14px; display: grid; gap: 4px; }
.alerts li::before { content: "•"; margin-right: 8px; }

.criteria { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; grid-template-columns: minmax(180px, 1fr) 3fr; gap: 20px; align-items: center; }
.payout { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; align-items: start; }
.guide-card .payout { border-top: 0; padding-top: 4px; }
.payout-formula { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; }
.payout-mine { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; }
.payout ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
@media (max-width: 860px) { .payout { grid-template-columns: 1fr; } }
.criteria-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.criteria-col { display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 10px; background: var(--bg-soft); text-align: center; }
.criteria-score { font-weight: 700; font-size: 14px; }
.criteria-raise { font-size: 12.5px; color: var(--muted); }
.criteria-raise b { color: var(--ink); }
.criteria-col.on { background: var(--ink); color: #fff; }
.criteria-col.on .criteria-raise, .criteria-col.on .criteria-raise b { color: #fff; }
.criteria-col.on .badge { border-color: #fff; }
@media (max-width: 860px) {
  .criteria { grid-template-columns: 1fr; gap: 12px; }
  .criteria-grid { gap: 4px; }
  .criteria-col { padding: 10px 2px; }
  .criteria-score { font-size: 12px; }
}

/* ── 등급 ── */
.badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-size: 13px; font-weight: 700; border: 1.5px solid var(--ink); flex: none;
}
.badge.lg { width: 34px; height: 34px; font-size: 16px; }
.badge.g-O { background: var(--ink); color: #fff; }
.badge.g-E { background: #4a4a4a; border-color: #4a4a4a; color: #fff; }
.badge.g-M { background: #9a9a9a; border-color: #9a9a9a; color: #fff; }
.badge.g-P { background: #e2e2e2; border-color: #e2e2e2; color: var(--ink); }
.badge.g-N { background: #fff; color: var(--ink); }
.badge.g-none { border-color: var(--line); color: var(--muted); }
.grades { display: inline-flex; gap: 6px; padding: 4px 0; }
.grades button {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg);
  font-weight: 700; cursor: pointer; transition: all .12s;
}
.grades button:hover:not(:disabled) { border-color: var(--ink); }
.grades button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.grades button:disabled { cursor: default; }
.grades.readonly button:not(.on) { color: #c4c4c4; border-color: var(--line-2); }

/* ── 탭 ── */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; }
.tabs button {
  background: none; border: 0; padding: 12px 0; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.pills { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pills button { height: 34px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; cursor: pointer; }
.pills button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── 과제 ── */
.category { margin-bottom: 36px; }
.category h2 { font-size: 20px; letter-spacing: -0.03em; display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.cat-weight { font-size: 13px; font-weight: 500; color: var(--muted); }
.task { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 12px; display: grid; gap: 18px; }
.task-head { display: flex; align-items: flex-start; gap: 14px; }
.task-no { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 9px; font-variant-numeric: tabular-nums; }
.task-title { flex: 1; min-width: 0; }
.title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.cat-select { width: 110px; margin: 0; flex: none; color: var(--ink-2); font-size: 13px; border-color: var(--line); }
.grid.goals { display: grid; grid-template-columns: 1fr 1fr 110px 130px; gap: 14px 24px; }
.grid.goals .wide { grid-column: 1 / -1; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.scale-col { padding: 8px 12px 6px; border-left: 1px solid var(--line); min-width: 0; }
.scale-col:first-child { border-left: 0; }
.scale-head { display: flex; align-items: baseline; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); }
.scale-head b { font-size: 14px; color: var(--ink); }
.scale-col.boss { background: var(--ink); }
.scale-col.boss .scale-head, .scale-col.boss .scale-head b, .scale-col.boss .text, .scale-col.boss .field { color: #fff; }
.scale-col.boss .field:hover, .scale-col.boss .field:focus { background: #2a2a2a; border-color: #555; }
.eval { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); margin: 0 -24px -22px; }
.eval-col { padding: 18px 24px 20px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.eval-col.boss { background: var(--bg-soft); border-left: 1px solid var(--line); border-radius: 0 0 var(--radius) 0; }
.eval-col:only-child { grid-column: 1 / -1; }
.eval-title { font-weight: 700; display: flex; align-items: baseline; gap: 8px; }
.eval-title span { font-size: 12px; font-weight: 500; color: var(--muted); }
.boss-row { display: flex; gap: 24px; flex-wrap: wrap; }
.score { display: flex; align-items: baseline; gap: 4px; }
.score .big-num { font-size: 26px; }
.eval-col.boss .field:hover { background: #ececec; }
.eval-col.boss .field:focus { background: #fff; }
.add-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.footnote { color: var(--muted); font-size: 12.5px; margin-top: 16px; }

/* ── 가이드·설문 ── */
.guide { display: grid; gap: 12px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.guide-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; display: grid; gap: 10px; align-content: start; }
.guide-card h3 { font-size: 17px; letter-spacing: -0.02em; }
.guide-card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.guide-card dl { margin: 0; display: grid; gap: 10px; }
.guide-card dt { font-weight: 700; }
.guide-card dd { margin: 0; color: var(--ink-2); }
.process { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.process-col { background: var(--bg-soft); border-radius: 10px; padding: 16px 18px; }
.process-head { font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; }
.process-head b { background: var(--ink); color: #fff; border-radius: 999px; padding: 0 10px; font-size: 13px; line-height: 24px; }
.survey { display: grid; gap: 12px; max-width: 820px; }
.qa { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; }
.q { font-weight: 700; margin-bottom: 6px; white-space: pre-wrap; }
.data { display: grid; gap: 12px; max-width: 720px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 80px 16px; display: grid; gap: 8px; }

/* ── 관리자 일괄 입력 (원본 시트 배치) ── */
.bulk-team { margin-top: 36px; scroll-margin-top: 76px; }
.bulk-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bulk-head h2 { font-size: 22px; letter-spacing: -0.03em; }
.bulk-head h2 span { font-size: 14px; font-weight: 500; }
.bulk-total { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 14px; color: var(--ink-2); }
.bulk-total .bad { color: var(--bad); font-weight: 700; }
.bulk-total b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bulk .table-wrap { margin-top: 12px; border-radius: 10px; }
.bulk .add-row { margin: 10px 0 0; }
.page:has(.bulk) { max-width: 1840px; }
.sheet-grid { border-collapse: collapse; table-layout: fixed; width: 100%; min-width: 1240px; font-size: 13px; }
.sheet-grid th { background: var(--bg-soft); font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 8px 6px; text-align: center; border: 1px solid var(--line); line-height: 1.35; }
.sheet-grid thead tr:first-child th { background: var(--ink); color: #fff; border-color: var(--ink); }
.sheet-grid thead tr:first-child th.sep { border-left-color: #555; }
.sheet-grid td { border: 1px solid var(--line); padding: 0; vertical-align: top; }
.sheet-grid tr > :first-child { border-left: 0; }
.sheet-grid tr > :last-child { border-right: 0; }
.sheet-grid thead tr:first-child th { border-top: 0; }
.sheet-grid tbody tr:last-child td { border-bottom: 0; }
/* 평가척도 O→N: 높은 등급일수록 진하게 */
.sheet-grid .sc-O { background: #d4d4d4; }
.sheet-grid .sc-E { background: #dfdfdf; }
.sheet-grid .sc-M { background: #e9e9e9; }
.sheet-grid .sc-P { background: #f2f2f2; }
.sheet-grid .sc-N { background: #fafafa; }
.sheet-grid th.sc { color: var(--ink); font-weight: 700; }
.sheet-grid .sc { border-color: #cfcfcf; }
.sheet-grid td.sc .field:hover { background: rgba(0, 0, 0, .05); }
.sheet-grid td.sc .field:focus { background: #fff; }
.sheet-grid td.sep { border-left: 2px solid var(--ink); }
.sheet-grid .field { margin: 0; width: 100%; border-radius: 0; padding: 8px 6px; min-height: 38px; border: 0; outline-offset: -2px; }
.sheet-grid .field:focus { outline: 2px solid var(--ink); }
.sheet-grid .suffix { padding-right: 6px; }
.sheet-grid .suffix .field { width: 100%; padding-right: 2px; }
.sheet-grid select.field { padding-right: 14px; background-position: calc(100% - 8px) 17px, calc(100% - 4px) 17px; }
.sheet-grid .score-cell { padding: 8px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.sheet-grid td.del { text-align: center; padding-top: 3px; }
.sheet-grid td.del .btn { padding: 0 8px; }

/* ── 표 ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; white-space: nowrap; }
.table thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg-soft); border-bottom-color: var(--line); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .bad { color: var(--bad); font-weight: 700; }
.table .partial { color: var(--muted); }
.table.rows tbody tr { cursor: pointer; }
.table.rows tbody tr:hover { background: var(--bg-soft); }
.table .go { color: var(--muted); font-size: 13px; text-align: right; }
.table.rows tr:hover .go { color: var(--ink); }
.table.compact th, .table.compact td { text-align: center; }
.table.members .field { margin: 0; width: 100%; min-width: 120px; border-color: var(--line); }
.table.members input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ink); }
.table.members tr.add { background: var(--bg-soft); }
.board .table td, .board .table th { white-space: pre-wrap; vertical-align: top; min-width: 96px; font-size: 13px; }
.board .table .long { min-width: 260px; }
.board .table tbody th { position: sticky; left: 0; background: var(--bg); font-weight: 700; white-space: nowrap; border-right: 1px solid var(--line); }
.board .table thead th { white-space: nowrap; }

@media (max-width: 860px) {
  .page { padding: 24px 16px 72px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .topbar .brand span, .user-name, .save-status { display: none; }
  .hero h1 { font-size: 30px; }
  .notice { grid-template-columns: 1fr; padding: 18px; }
  .steps li { min-width: 0; flex: 1; padding: 8px 10px; }
  .task { padding: 18px 16px; }
  .task-head { flex-wrap: wrap; }
  .task-title { flex-basis: calc(100% - 40px); }
  .grid.goals { grid-template-columns: 1fr 1fr; }
  .scale { grid-template-columns: 1fr; }
  .scale-col { border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 90px 1fr; align-items: center; }
  .scale-col:first-child { border-top: 0; }
  .scale-head { justify-content: flex-start; }
  .scale-col .center { text-align: left; }
  .eval { grid-template-columns: 1fr; margin: 0 -16px -18px; }
  .eval-col { padding: 16px; }
  .eval-col.boss { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
}
