:root {
  --navy: #172c36;
  --ink: #24383f;
  --muted: #738087;
  --line: #e3e8e7;
  --bg: #f5f7f6;
  --green: #247263;
  --lime: #e5f0e9;
  --gold: #b87931;
  --red: #ac5146;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 14px/1.6 'Segoe UI', 'Malgun Gothic', sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-decoration: none; }

/* Login Layout */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(155deg, #172c36 0%, #21404b 55%, #245b52 100%);
}
.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 36px 34px 30px;
  box-shadow: 0 20px 60px rgba(12, 26, 33, 0.35);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--navy);
  color: #e9eee1;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
}
.auth-brand-icon span { color: #8cbc9e; font-size: 16px; }
.auth-brand h1 { font-size: 20px; margin: 0; letter-spacing: -0.5px; }
.auth-brand small { display: block; font-size: 11px; color: var(--muted); }
.auth-desc { font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #d5dedb;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 13px;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid #9ec5b5;
  outline-offset: 1px;
}
.auth-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.65;
}

/* Portal Shell */
.sidebar {
  position: fixed;
  width: 244px;
  inset: 0 auto 0 0;
  background: var(--navy);
  color: #c4cece;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 19px;
  font-weight: 650;
  padding: 0 6px;
}
.brand small {
  font-size: 9px;
  letter-spacing: 1.4px;
  display: block;
  color: #91aaa8;
  margin-top: 2px;
}
.brand-icon { font-size: 32px; color: #e9eee1; line-height: 1; }
.brand-icon span { font-size: 21px; color: #9bbbaa; }
.workspace-label {
  margin: 34px 12px 12px;
  font-size: 11px;
  color: #839b9d;
  letter-spacing: 0.4px;
}
nav { display: grid; gap: 6px; }
nav button {
  border: 0;
  border-radius: 7px;
  background: none;
  color: #bdcacc;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 11px 14px;
  font-size: 13px;
}
nav button span { font-size: 18px; width: 20px; text-align: center; }
nav button:hover { background: #263e47; }
nav button.active { background: #36534f; color: #fff; font-weight: 600; }
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #3a4c53;
  padding: 20px 10px 0;
  font-size: 12px;
}
.sidebar-bottom small {
  display: block;
  color: #8fa4a8;
  font-size: 11px;
  line-height: 1.75;
  margin-top: 8px;
}
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8cbc9e;
  margin-right: 6px;
}

.shell { margin-left: 244px; min-height: 100vh; display: flex; flex-direction: column; }
header {
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 36px;
  gap: 16px;
  flex-wrap: wrap;
}
.breadcrumb { font-size: 12px; color: var(--muted); }
.breadcrumb span { margin: 0 10px; color: #bdc5c5; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.avatar {
  display: grid;
  place-items: center;
  background: #e3ece8;
  color: var(--green);
  font-weight: 700;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 12px;
}
main { padding: 32px 36px 44px; max-width: 1520px; width: 100%; margin: 0 auto; flex: 1; }
footer {
  margin: 0 36px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #8b9698;
  display: flex;
  justify-content: space-between;
}

/* Components */
h1 { font-size: 26px; letter-spacing: -0.8px; line-height: 1.25; margin: 0 0 8px; font-weight: 650; }
h2 { font-size: 16px; margin: 0; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; }
p { margin: 5px 0; }
.subtle { font-size: 12px; color: var(--muted); }
.eyebrow { font-size: 10px; letter-spacing: 1.6px; color: var(--green); font-weight: 700; margin-bottom: 6px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; gap: 18px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { background: #eef3f0; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: #1d5f52; }
.btn.danger { background: #faeae6; border-color: #e6c3bc; color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 11px; }
.btn.full { width: 100%; padding: 11px 16px; font-size: 13px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #edf2ef;
  color: #3f6a5e;
  white-space: nowrap;
  display: inline-block;
  font-weight: 600;
}
.pill.amber { background: #f9efdf; color: #a77432; }
.pill.red { background: #faeae6; color: #b15b4c; }
.pill.gray { background: #edf0f1; color: #67757c; }
.pill.navy { background: #e5ecef; color: #172c36; }

.notice {
  border: 1px solid #e4dfd1;
  border-left: 3px solid #c1995f;
  background: #fbf9f3;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 12px;
  color: #6e5d43;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.notice.secret-box {
  border-color: #bdd6cb;
  border-left: 4px solid var(--green);
  background: #eff7f3;
  color: #1d4d42;
}
.secret-code {
  font-family: Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  background: #fff;
  border: 1px solid #bdd6cb;
  padding: 4px 10px;
  border-radius: 5px;
  user-select: all;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; }
.card .label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.card .value { font-size: 27px; line-height: 1.3; letter-spacing: -0.8px; margin: 10px 0 6px; font-weight: 650; }
.card .value small { font-size: 13px; font-weight: 400; margin-left: 4px; }
.card .hint { font-size: 11px; color: var(--muted); }
.card.highlight { background: #f0f5f1; border-color: #d3e0d8; }

.grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin-bottom: 22px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 22px; }
.panel-head {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0ef;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-body { padding: 20px 22px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
th {
  background: #f8faf9;
  color: #738087;
  font-weight: 600;
  padding: 11px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
td { border-bottom: 1px solid #edf0ef; padding: 13px 16px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #f6faf8; }
td.number { text-align: right; font-variant-numeric: tabular-nums; }
.source-title { font-weight: 600; color: #2b4448; }
.cell-sub { font-size: 11px; color: #849193; margin-top: 2px; }

.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select {
  border: 1px solid #dce3df;
  border-radius: 6px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}
.search { min-width: 240px; flex: 1; max-width: 400px; }
.toolbar .count { margin-left: auto; font-size: 12px; color: var(--muted); }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 14px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid #edf0ef; }

.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.scope-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  background: #fafcfb;
}
.scope-item input { width: auto; margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.error-text { color: var(--red); font-size: 12px; margin: 8px 0; min-height: 18px; }
.empty { padding: 38px 20px; text-align: center; color: var(--muted); }

.bar-row { margin-bottom: 16px; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.bar-track { height: 11px; background: #eef1ef; border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: #347d6d; border-radius: 3px; }

dialog {
  border: 0;
  border-radius: 12px;
  width: min(720px, 94vw);
  padding: 0;
  box-shadow: 0 18px 70px rgba(23, 44, 54, 0.28);
  color: var(--ink);
  max-height: 90vh;
}
dialog::backdrop { background: rgba(21, 44, 58, 0.45); backdrop-filter: blur(2px); }
.dialog-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-content { padding: 22px 24px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.detail-item { padding: 11px 13px; background: #f7f9f7; border-radius: 6px; font-size: 12px; overflow-wrap: anywhere; }
.detail-item small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 14px; }

#toast {
  position: fixed;
  right: 26px;
  bottom: 24px;
  background: #203c33;
  color: #fff;
  border-radius: 7px;
  padding: 11px 18px;
  opacity: 0;
  transform: translateY(16px);
  transition: 0.2s;
  z-index: 20;
  font-size: 13px;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .grid, .form-row, .detail-grid { grid-template-columns: 1fr; }
  .sidebar { position: relative; width: 100%; padding: 16px; }
  .workspace-label, .sidebar-bottom { display: none; }
  nav { display: flex; overflow-x: auto; margin-top: 12px; }
  nav button { white-space: nowrap; padding: 8px 12px; }
  .shell { margin-left: 0; }
  header, main, footer { padding-left: 18px; padding-right: 18px; margin-left: 0; margin-right: 0; }
}

.award-note{display:block;font-size:11px;line-height:1.6;color:#65767b;text-align:left;white-space:normal;max-width:330px;margin-top:6px}.work-item input{min-width:120px}#work-note,#publish-note{width:100%;min-height:80px}
/* Results: workbook-inspired entity columns */
.entity-board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:start}.entity-board.single{grid-template-columns:minmax(0,1fr);max-width:900px;margin:auto}.entity-panel{--accent:#ac6029;--tint:#fff5eb;border:1px solid #e0e5e9;border-radius:16px;background:white;overflow:hidden;min-width:0}.entity-panel.legal{--accent:#274e80;--tint:#eff4fc}.entity-heading{display:flex;align-items:center;justify-content:space-between;background:var(--accent);color:white;padding:20px 24px}.entity-heading h2{font-size:23px;color:white;margin-top:3px}.entity-heading small,.entity-heading>span{font-size:11px;opacity:.9}.entity-total{padding:24px;background:var(--tint);display:grid;gap:5px}.entity-total>span{font-size:12px;color:#53616d}.entity-total strong{font-size:clamp(25px,2.4vw,37px);letter-spacing:-1px;font-variant-numeric:tabular-nums;color:var(--accent)}.entity-total small{font-size:11px;color:#65717d}.entity-total strong small{font-size:15px;margin-left:6px}.entity-section{padding:22px 24px;border-top:1px solid #edf0f3}.entity-section>h3{font-size:14px;margin:0 0 18px}.payout-row{display:grid;grid-template-columns:76px minmax(20px,1fr) 116px;align-items:center;gap:10px;margin:14px 0;font-size:12px}.payout-row b{text-align:right;font-variant-numeric:tabular-nums}.payout-row small{font-weight:400;color:#6d7b86}.payout-track{height:10px;background:var(--tint);border-radius:4px;overflow:hidden}.payout-track i{display:block;height:100%;background:var(--accent);border-radius:4px}.team-result{padding:18px 0;border-top:1px solid #e9edf1}.team-result:first-of-type{border-top:0;padding-top:0}.team-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;gap:10px;flex-wrap:wrap}.team-title h4{margin:0;font-size:14px}.team-metrics{display:grid;grid-template-columns:1.15fr .7fr 1.15fr;gap:8px}.team-metrics span{display:block;font-size:10px;color:#71808a;margin-bottom:4px}.team-metrics b{font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.team-metrics small{font-size:10px;font-weight:400}.team-award b{color:var(--accent)}.team-rule{display:block;font-size:10px;line-height:1.7;color:#71808a;margin-top:12px}.achievement-track{position:relative;height:6px;background:#edf0f3;border-radius:4px;margin-top:16px}.achievement-track i{display:block;height:100%;border-radius:4px;background:var(--accent)}.achievement-track em{position:absolute;left:66.667%;top:-3px;height:12px;width:1px;background:#788692}.achievement-scale{display:flex;justify-content:space-between;font-size:9px;color:#788692;margin-top:4px;position:relative}.achievement-scale span:nth-child(2){position:absolute;left:66.667%;transform:translateX(-50%)}.people-group{border:1px solid #e4e9ee;border-radius:8px;margin-top:12px;overflow:hidden}.people-group summary{padding:12px 14px;background:var(--tint);cursor:pointer;font-size:12px}.people-group summary span{float:right;color:#6b7780;font-size:11px}.people-group th,.people-group td{padding:12px 14px}.people-group td:first-child{white-space:nowrap}.people-group .award-note{margin-left:auto;text-align:right;max-width:280px;font-size:10px}.people-group th.number{text-align:right}.result-summary{display:flex;align-items:center;gap:40px;background:white;border:1px solid #e0e5e9;border-radius:12px;padding:22px 26px}.result-summary>div{display:grid;gap:4px}.result-summary span{font-size:11px;color:#6b7983}.result-summary strong{font-size:24px;font-variant-numeric:tabular-nums}.result-summary strong small{font-size:12px;font-weight:400}.result-summary>.pill{margin-left:auto}.result-baseline{font-size:11px;color:#75828b;margin:12px 0 22px}
@media(min-width:981px){.sidebar{width:210px;padding-left:12px;padding-right:12px}.shell{margin-left:210px}main{padding:28px 24px;max-width:1700px}header{padding:12px 24px}}
@media(max-width:1200px){.entity-section{padding:18px 16px}.payout-row{grid-template-columns:70px minmax(15px,1fr) 103px;gap:6px}.team-metrics b{font-size:12px}}
@media(max-width:760px){.entity-board{grid-template-columns:minmax(0,1fr);gap:24px}.result-summary{gap:16px;flex-wrap:wrap;padding:18px}.result-summary>div:first-child{width:100%}.result-summary strong{font-size:22px}.result-summary>.pill{margin-left:0}.entity-heading h2{font-size:22px}.entity-total strong{font-size:32px}.team-metrics b{font-size:13px}.header-right{gap:6px}.entity-section{padding:20px 16px}}
.build-info{margin-top:auto;padding:18px 10px 10px;color:#b9cbce;font-size:11px}.build-info small{display:block;font-size:10px;margin-top:4px}.sidebar-bottom{margin-top:0}.award-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.award-fields label{font-size:11px;color:#647580}.award-fields input,.award-fields select{display:block;width:100%;min-width:0;padding:8px;border:1px solid #d8e0e5;border-radius:5px;color:#24383f;background:white}.staff-editor{border:1px solid #e1e7eb;border-radius:8px;padding:14px;margin:14px 0;background:#fafcfd}.rule-editor{margin:12px 0}.rule-editor summary{cursor:pointer;font-size:12px;padding:8px 0}.team-title-award{margin-left:auto;color:var(--accent);font-size:17px}.team-title-award small{font-weight:400;font-size:11px}.team-title{gap:10px;flex-wrap:wrap}.performance-line{display:flex;gap:18px;align-items:center}.performance-visual{display:flex;align-items:center;gap:12px;flex:1;min-width:0}.performance-visual strong{font-size:13px;white-space:nowrap}.performance-visual small{font-weight:400;font-size:10px}.achievement-number{display:grid;text-align:right}.achievement-number small{font-size:10px;color:#74818b}.achievement-number b{font-size:14px}.password-toggle{font-size:10px;margin:4px 0;background:transparent;border:0;color:#247263;cursor:pointer}

/* ── 팀 고유 컬러 pill ── */
.pill.tc-b1{background:#dbeafe;color:#1e3a7b;border:1px solid #93c5fd}
.pill.tc-b2{background:#d1fae5;color:#1a5c37;border:1px solid #6ee7b7}
.pill.tc-b3{background:#ede9fe;color:#4c1d95;border:1px solid #c4b5fd}
.pill.tc-sup{background:#fef3c7;color:#78350f;border:1px solid #fcd34d}
.pill.tc-pat{background:#fee2e2;color:#7f1d1d;border:1px solid #fca5a5}
.pill.tc-eval{background:#e0f2fe;color:#0c4a6e;border:1px solid #7dd3fc}
.pill.tc-mgmt{background:#f1f5f9;color:#334155;border:1px solid #94a3b8}

/* ── 달성 여부 색상 반전 뱃지 ── */
.pill.pill-solid-green{background:#1a7a52;color:#fff;border:1px solid #15643f;font-weight:700}
.pill.pill-solid-red{background:#c0392b;color:#fff;border:1px solid #a02a1f;font-weight:700}

/* ── 달성 게이지 고정 색 (팀색 무관) ── */
.achievement-track i{background:#2563eb !important}

/* ── 게이지 래퍼 & 마커 ── */
.gauge-wrap{flex:1;min-width:80px;display:flex;flex-direction:column;gap:4px;padding-top:18px}
.achievement-track{position:relative;width:100%;height:10px !important;flex:none !important;margin:0 !important;background:#e2e8f0;border-radius:5px;overflow:visible}
.achievement-track i{display:block;height:100%;border-radius:5px;background:#2563eb;position:relative;z-index:1}
.gauge-marker{position:absolute;top:-18px;bottom:-2px;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;justify-content:flex-end;z-index:2;pointer-events:none}
.gauge-marker-label{font-size:9px;color:#92400e;white-space:nowrap;font-weight:700;background:#fef3c7;border:1px solid #f59e0b;padding:0 4px;border-radius:3px;margin-bottom:2px;line-height:1.3}
.gauge-marker-line{width:2px;height:14px;background:#d97706;border-radius:1px}
.gauge-axis{display:flex;justify-content:space-between;font-size:9px;color:#788692;margin-top:2px;position:relative;height:14px}

/* ── 성과 요약 카드 레이블 ── */
.result-label{display:block;font-size:9px;font-weight:600;letter-spacing:.04em;color:#8a9ba8;text-transform:uppercase;margin-bottom:1px}
.team-title-right{display:flex;flex-direction:column;align-items:flex-end;margin-left:auto}
.team-title-right .result-label{text-align:right}
.perf-amount-wrap{display:flex;flex-direction:column;white-space:nowrap}
.perf-amount-wrap strong{font-size:13px}

/* ── 사이드바 마스터 전용 섹션 구분선 ── */
.nav-section-label{font-size:9px;font-weight:700;letter-spacing:.08em;color:#8bb0a8;text-transform:uppercase;padding:14px 10px 4px;margin-top:4px;border-top:1px solid rgba(255,255,255,.12)}

@media(max-width:980px){.build-info{display:block;padding:6px 10px;font-size:10px}.build-info small{display:inline;margin-left:8px}}@media(max-width:480px){.award-fields{grid-template-columns:1fr}.performance-line{gap:8px}.performance-visual strong{font-size:12px}.team-title-award{font-size:15px}}
