#loadingScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

/* Team forecast summary */
.kpi-grid {
  display: block;
}

.forecast-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.forecast-hero .kpi {
  min-height: 154px;
  padding: 22px 20px;
}

.forecast-hero .kpi span {
  font-size: 14px;
  font-weight: 800;
}

.forecast-hero .kpi strong {
  font-size: 34px;
  letter-spacing: 0;
}

.current-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.current-kpi-strip .kpi {
  min-height: 116px;
  padding: 16px;
}

.current-kpi-strip .kpi strong {
  font-size: 24px;
}

.owner-summary-row {
  cursor: pointer;
}

.owner-summary-row:hover td {
  background: #f8fbff;
}

.owner-summary-row.open td {
  background: #f5f9ff;
}

.owner-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 7px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 800;
}

.owner-summary-row.open .owner-toggle {
  background: #1e3a8a;
  color: #fff;
}

.owner-detail-row td {
  padding: 0 16px 16px !important;
  background: #f8fbff;
}

.owner-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #d7e3f3;
  border-radius: 8px;
  background: #fff;
}

.owner-detail-panel h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.owner-detail-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.owner-history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.owner-history-table th,
.owner-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8eef7;
  text-align: right;
  white-space: nowrap;
}

.owner-history-table th:first-child,
.owner-history-table td:first-child {
  text-align: left;
}

.owner-history-table span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.owner-detail-empty {
  padding: 16px;
  border: 1px solid #d7e3f3;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}
#loadingScreen.hide {
  opacity: 0;
  pointer-events: none;
}
.loading-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dot {
  display: block;
  border-radius: 999px;
}
.dot-navy {
  width: 22px;
  height: 22px;
  background: #27378d;
  animation: dotBounce 1.1s ease-in-out infinite;
}
.dot-blue {
  width: 14px;
  height: 14px;
  background: #0b84c6;
  animation: dotBounce 1.1s ease-in-out 0.2s infinite;
}
@keyframes dotBounce {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  40%       { transform: translateY(-12px) scale(1.1); opacity: 0.85; }
  60%       { transform: translateY(-6px) scale(1.05); opacity: 0.9; }
}

#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#loadingText {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --line: #d9e2ee;
  --text: #07172f;
  --muted: #607089;
  --blue: #1f55d6;
  --navy: #182d73;
  --green: #16a05d;
  --red: #dc3f4b;
  --amber: #e8891c;
  --teal: #0f9f9a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  padding: 10px 15px;
  cursor: pointer;
}

button.active,
button:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 10px;
}

.topbar .tabs {
  margin-bottom: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand img {
  width: 138px;
  height: 56px;
  object-fit: contain;
}

.brand h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: 0;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.controls {
  display: flex;
  align-items: end;
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

input[type="month"] {
  cursor: pointer;
}

label:has(input[type="month"]) {
  cursor: pointer;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 42px;
}

.sub-bar .controls {
  margin-left: auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.brief-card,
.panel,
.kpi {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(18, 38, 63, 0.06);
}

.brief-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px;
  margin-bottom: 14px;
}

.eyebrow {
  display: block;
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

.brief-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi {
  min-height: 126px;
  padding: 18px;
}

.kpi span {
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.kpi small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.up {
  color: var(--green);
}

.down {
  color: var(--red);
}

.main-grid,
.person-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  align-items: stretch;
}

.owner-grid {
  grid-template-columns: 1fr;
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 20px;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
}

.table-wrap table {
  min-width: 1180px;
}

.owner-grid .table-wrap table {
  min-width: 0;
}

.owner-grid table {
  table-layout: fixed;
  font-size: 13px;
}

.owner-grid th:nth-child(1),
.owner-grid td:nth-child(1) { width: 86px; }
.owner-grid th:nth-child(2),
.owner-grid td:nth-child(2) { width: 120px; }
.owner-grid th:nth-child(3),
.owner-grid td:nth-child(3) { width: 92px; }
.owner-grid th:nth-child(4),
.owner-grid td:nth-child(4) { width: 190px; }
.owner-grid th:nth-child(5),
.owner-grid td:nth-child(5) { width: 150px; }
.owner-grid th:nth-child(6),
.owner-grid td:nth-child(6),
.owner-grid th:nth-child(7),
.owner-grid td:nth-child(7) { width: 104px; }
.owner-grid th:nth-child(8),
.owner-grid td:nth-child(8) { width: 150px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid #e7edf5;
  padding: 11px 10px;
  text-align: right;
  white-space: nowrap;
  vertical-align: top;
}

th:first-child,
td:first-child {
  text-align: left;
}

.cell-main {
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.cell-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.mini-breakdown {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 8px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid #e7edf5;
  border-radius: 6px;
  background: #f9fbfe;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.mini-breakdown strong {
  color: var(--text);
  text-align: right;
}

th {
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 700;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e2e9f3;
  border-radius: 7px;
  padding: 10px 12px;
}

.status-row strong {
  font-size: 18px;
}

.status-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.status-row em {
  grid-column: 1 / -1;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

.chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(26px, 1fr);
  align-items: end;
  gap: 10px;
  min-height: 270px;
  border: 1px solid #e2e9f3;
  border-radius: 8px;
  padding: 16px 12px 10px;
  background: linear-gradient(#fff, #fff), repeating-linear-gradient(to top, transparent 0 54px, #edf2f7 55px);
}

.bar-group {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 6px;
  height: 235px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

.bars {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 4px;
  height: 190px;
}

.bar {
  width: 9px;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
}

.bar.db {
  background: var(--blue);
}

.bar.work {
  background: var(--teal);
}

.bar-label {
  color: var(--text);
  font-weight: 700;
}

.check-cards,
.person-cards,
.question-list {
  display: grid;
  gap: 10px;
}

.check-card,
.person-card,
.question {
  border: 1px solid #e2e9f3;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.check-card strong,
.person-card strong {
  display: block;
  margin-bottom: 8px;
}

.person-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.person-filter select {
  min-width: 240px;
}

.period-badge {
  color: var(--muted);
  font-size: 13px;
}

/* ── 블록 타이틀 ── */
.block-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 18px 0 10px;
  padding-left: 4px;
  border-left: 3px solid var(--blue);
  padding-left: 10px;
}

/* ── stat-cards ── */
.stat-cards {
  margin-bottom: 14px;
}

#personStatCards,
#personThisStatCards {
  margin-bottom: 24px;
}

.stat-cards-row {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 3fr);
  gap: 14px;
  align-items: start;
}

/* 이번달 현재: DB카드(auto) + 예상카드(1fr) + 3stat카드(auto) */
.stat-cards-row.has-projection {
  grid-template-columns: minmax(220px, .75fr) minmax(240px, 1fr) minmax(0, 2.2fr);
}

/* DB 상세 카드 - 텍스트 딱 맞는 너비 */
.stat-card-db {
  min-width: 230px;
  max-width: none;
}

/* 월말 예상 카드 */
.stat-card-proj {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: #f7f9fc;
}

.proj-main {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  margin: 8px 0 4px;
}

.proj-sub {
  font-size: 12px;
  color: var(--muted);
}

.stat-cards-right {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1.18fr) minmax(200px, .9fr);
  gap: 14px;
  align-items: start;
}

/* DB 상세 카드 */
.stat-card-db {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.db-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 14px;
}

.dbb-row {
  display: grid;
  grid-template-columns: 88px minmax(58px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.dbb-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.dbb-row strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
}

.dbb-work, .dbb-pre, .dbb-note {
  font-size: 12px;
  color: var(--muted);
  white-space: normal;
  line-height: 1.35;
}

.dbb-pre em {
  font-style: normal;
  font-weight: 700;
  color: var(--blue);
}

.dbb-total {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
}

.dbb-total strong {
  color: var(--navy);
  font-size: 26px;
}

.dbb-note {
  background: #eef3ff;
  color: var(--navy);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
}

.stat-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(18,38,63,.05);
  min-height: 0;
}

.channel-stat-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.channel-lines,
.content-metric {
  display: grid;
  gap: 8px;
}

.channel-lines > div,
.content-metric {
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  align-items: baseline;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 8px;
}

.channel-lines > div {
  display: grid;
  column-gap: 12px;
}

.channel-lines > div:last-child,
.content-stat .content-metric:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.channel-lines span,
.content-metric span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.channel-lines strong,
.content-metric strong {
  font-size: 22px;
  color: var(--text);
  white-space: nowrap;
  min-width: 0;
}

.channel-lines em,
.content-metric em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  margin-top: -2px;
  white-space: nowrap;
  text-align: left;
}

.stat-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 14px;
  white-space: nowrap;
}

.stat-main {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  white-space: nowrap;
}

.stat-sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.stat-diff {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.stat-diff .arrow {
  font-size: 11px;
}

.stat-diff .pct {
  color: var(--muted);
  font-size: 12px;
}

.stat-diff.up { color: var(--green); }
.stat-diff.down { color: var(--red); }

/* ── person-lower-grid ── */
.person-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .95fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}

.person-lower-grid > .panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.person-lower-grid > .this-month-panel {
  grid-column: 1 / -1;
}

/* ── 콘텐츠 상세 ── */
.content-stat-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.content-stat {
  flex: 1;
  border: 1px solid #e2e9f3;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfdff;
}

.content-stat .content-metric + .content-metric {
  margin-top: 8px;
}

.cs-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.cs-main { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.cs-sub { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cs-diff { font-size: 12px; }
.cs-diff.up { color: var(--green); }
.cs-diff.down { color: var(--red); }

/* ── 키워드 칩 ── */
.kw-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.keyword-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eef3ff;
  color: var(--navy);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}

.kw-chip em {
  font-style: normal;
  border-radius: 10px;
  padding: 0 6px;
  font-size: 11px;
}

.kw-chip .kw-views {
  color: #c0392b;
  font-weight: 600;
  background: none;
  padding: 0;
}

.kw-chip .kw-views-empty {
  display: none;
}

.kw-chip .kw-count {
  background: var(--navy);
  color: #fff;
}

.kw-chip.muted { background: #f3f5f8; color: var(--muted); }

/* ── 벤치마크 ── */
.bench-list { display: grid; gap: 8px; }

.bench-list:empty {
  display: none;
}

/* ── 벤치마크 비교 행 ── */
.bench-compare-row {
  border: 1px solid #e2e9f3;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.bench-compare-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.bench-compare-vals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bench-compare-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bench-compare-item strong {
  font-size: 20px;
  font-weight: 700;
}

.bci-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: #f3f5f8;
  border-radius: 4px;
  padding: 2px 6px;
  width: fit-content;
}

.bci-tag.my {
  color: var(--navy);
  background: #eef3ff;
}

.bench-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #e2e9f3;
  border-radius: 7px;
  font-size: 14px;
}

.bench-row strong { font-size: 16px; text-align: right; }
.bench-row small { font-size: 12px; white-space: nowrap; }
.bench-row.muted-row { opacity: 0.55; }
.muted { color: var(--muted); }

/* ── person-bottom-grid ── */
.person-bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

/* ── 블로그/유튜브 작업 목록 ── */
.person-work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.this-month-panel .stat-cards {
  margin-bottom: 0;
}

.this-month-panel #personThisStatCards {
  margin-bottom: 0;
}

.this-month-panel .stat-cards-row.has-projection {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  grid-template-areas:
    "db proj"
    "right right";
  gap: 12px;
  align-items: stretch;
}

.this-month-panel .stat-card-db {
  grid-area: db;
}

.this-month-panel .stat-card-proj {
  grid-area: proj;
  min-height: 0;
  padding: 18px;
}

.this-month-panel .stat-cards-right {
  grid-area: right;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.this-month-panel .salary-card {
  grid-column: 1 / -1;
}

.this-month-panel .channel-stat-card,
.this-month-panel .salary-card {
  padding: 14px 16px;
}

.this-month-panel .channel-lines > div {
  grid-template-columns: minmax(78px, auto) minmax(0, 1fr);
}

.this-month-panel .channel-lines span {
  font-size: 12px;
}

.this-month-panel .channel-lines strong {
  font-size: 20px;
}

.this-month-panel .stat-main {
  font-size: 27px;
}

.this-month-panel .stat-sub {
  line-height: 1.35;
}

.sort-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
}

.sort-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.sort-tabs button.active {
  background: var(--navy);
  color: #fff;
}

.work-url-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}

.work-url-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e2e9f3;
  border-radius: 7px;
  background: #fbfdff;
  font-size: 13px;
}

.wui-date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  min-width: 78px;
}

.wui-kw {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wui-link {
  color: var(--blue);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}

.wui-link:hover {
  text-decoration: underline;
}

/* ── 장기 차트 ── */
.chart-scroll {
  position: relative;
  height: 260px;
  border: 1px solid #e2e9f3;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.bar-group-sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 44px;
}

.bar-group-sm .bars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  height: 130px;
}

.bar-label-sm {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
}

.bar-month {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.no-data {
  color: var(--muted);
  font-size: 14px;
  padding: 20px;
}

/* 급여 히스토리 표 */
.salary-summary-row {
  background: #f0f4ff;
  border-top: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
}

.salary-summary-row td {
  font-size: 14px;
}

.sal-team-sub {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}

textarea {
  width: 100%;
  height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.6;
  color: var(--text);
  background: #fbfdff;
}

#copyPersonMemo {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .topbar,
  .brief-card {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-grid,
  .person-grid {
    grid-template-columns: 1fr;
  }
}


/* ── 급여 카드 ? 말풍선 ──────────────────────────────── */
.salary-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent, #1f55d6);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
  line-height: 1;
  user-select: none;
}

.salary-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  transform: none;
  background: #1a2840;
  color: #e8f0fe;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.7;
  padding: 10px 13px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.salary-tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 10px;
  transform: none;
  border: 5px solid transparent;
  border-bottom-color: #1a2840;
}

.salary-help:hover .salary-tooltip,
.salary-help:focus .salary-tooltip {
  display: block;
}

/* ── 동기화 버튼 ─────────────────────────────────────── */
.sync-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sync-btn {
  padding: 4px 12px;
  font-size: 12px;
  border: 1px solid var(--accent, #1f55d6);
  border-radius: 6px;
  background: transparent;
  color: var(--accent, #1f55d6);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.sync-btn:hover { background: var(--accent, #1f55d6); color: #fff; }
.sync-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.sync-status {
  font-size: 11px;
  color: #8a9bb5;
}
.sync-status.synced  { color: #0f9f6e; }
.sync-status.unsynced { color: #e07b3a; }
.sync-status.syncing { color: #1f55d6; }
.sync-status.error   { color: #d93025; }

/* ── 유튜브 조회수 ───────────────────────────────────── */
.wui-views {
  font-size: 12px;
  color: #c0392b;
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}
.wui-views-none {
  color: #b0bec5;
  font-weight: 400;
}

/* 담당자 성과 카드 레이아웃 보정 */
.salary-card {
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}

.salary-card .stat-main {
  color: var(--navy);
}

.salary-card .stat-diff {
  margin-top: 6px;
}

/* 급여 카드 v2 — 인센티브 유형 선택 포함 */
.salary-card-v2 {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  min-width: 0;
}

.salary-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.salary-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #60718a);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.salary-total {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}

.salary-breakdown {
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  background: #f2f6fb;
  border-radius: 8px;
}

.sb-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sb-row span {
  font-size: 11px;
  color: var(--text-muted, #60718a);
}

.sb-row strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.sb-row strong.positive {
  color: #16a34a;
}

.salary-incentive-type {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line, #d8e2f0);
  border-radius: 8px;
  background: #fff;
}

.sit-label {
  font-size: 11px;
  color: var(--text-muted, #60718a);
}

.sit-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.sit-meta {
  font-size: 11px;
  color: var(--text-muted, #60718a);
}

.inc-type-change-btn {
  margin-top: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--blue, #1f55d6);
  border-radius: 6px;
  background: #fff;
  color: var(--blue, #1f55d6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  align-self: flex-start;
}

.inc-type-change-btn:hover:not([disabled]) {
  background: var(--blue, #1f55d6);
  color: #fff;
}

.inc-type-change-btn.locked,
.inc-type-change-btn[disabled] {
  border-color: var(--line, #d8e2f0);
  color: var(--text-muted, #60718a);
  cursor: not-allowed;
  background: #f8fbff;
}

.salary-alt-compare {
  padding: 8px 10px;
  background: #f8fbff;
  border-radius: 8px;
  border: 1px dashed var(--line, #d8e2f0);
}

.salary-alt-compare.alt-better {
  border-color: #16a34a;
  background: #f0fdf4;
}

.sac-label {
  font-size: 11px;
  color: var(--text-muted, #60718a);
  margin-bottom: 4px;
}

.sac-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sac-row span {
  font-size: 12px;
  color: var(--text-muted, #60718a);
}

.sac-row strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.sac-total {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy) !important;
}

.sac-diff {
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}

.sac-diff.positive { color: #16a34a; }
.sac-diff.negative { color: #dc2626; }
.sac-diff.neutral { color: var(--text-muted, #60718a); }

.salary-reason {
  font-size: 12px;
  color: var(--text-muted, #60718a);
}

.salary-reason summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  font-size: 12px;
  padding: 2px 0;
}

.salary-reason p {
  margin: 6px 0 0;
  line-height: 1.6;
  color: #4a5568;
}

/* 3안: 요약 카드 + 상세 표 */
.summary-table-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* DB 3개 + 급여카드 v2 나란히 배치 */
.summary-table-layout > .salary-card-v2 {
  margin: 0;
}

.summary-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

/* DB 카드 3개 그리드 */
.summary-card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* 이번달 급여 카드 인라인 — summary-card 스타일 통일 */
.salary-card-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}

.sci-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.sci-total {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}

.sci-breakdown {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted, #60718a);
  font-size: 12px;
}

.sci-breakdown strong {
  color: var(--navy);
  font-weight: 700;
}

.sci-breakdown .text-positive {
  color: #16a34a;
}

.sci-sep {
  color: var(--line, #d8e2f0);
  font-size: 14px;
}

.sci-type-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--line, #d8e2f0);
  border-bottom: 1px solid var(--line, #d8e2f0);
}

.sci-type-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: #e8eeff;
  color: var(--navy);
}

.sci-lock-info {
  font-size: 11px;
  color: var(--text-muted, #60718a);
}

.inc-type-change-btn.sci-change-btn {
  padding: 3px 10px;
  font-size: 11px;
  margin-top: 0;
  border-radius: 20px;
}

.sci-compare {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted, #60718a);
}

.sci-compare strong {
  color: var(--navy);
  font-weight: 700;
}

.sci-compare-label {
  font-size: 11px;
  color: var(--text-muted, #60718a);
  white-space: nowrap;
}

.sci-compare-diff {
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}

.sci-compare.alt-better {
  color: #16a34a;
}

.sci-compare.alt-better .sci-compare-label {
  color: #16a34a;
}

.text-positive { color: #16a34a; }
.text-negative { color: #dc2626; }

.sci-reason {
  font-size: 11px;
  color: var(--text-muted, #60718a);
  border-top: 1px solid var(--line, #d8e2f0);
  padding-top: 6px;
}

.sci-reason summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  font-size: 11px;
}

.sci-reason p {
  margin: 5px 0 0;
  line-height: 1.6;
  color: #4a5568;
}

.salary-choice-card {
  gap: 14px;
  padding: 18px;
  border-left: 4px solid #1f55d6;
  background:
    linear-gradient(135deg, rgba(31, 85, 214, .08), rgba(22, 160, 93, .045)),
    #fff;
}

.salary-choice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line, #d8e2f0);
}

.salary-choice-head > div {
  display: grid;
  gap: 5px;
}

.salary-choice-head small {
  color: var(--text-muted, #60718a);
  font-size: 12px;
  line-height: 1.45;
}

.salary-choice-lock {
  flex: 0 0 auto;
  max-width: 310px;
  padding: 7px 10px;
  border: 1px solid #bfd4ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: #1746a2;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.salary-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.salary-plan-option {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line, #d8e2f0);
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
}

.salary-plan-option.selected {
  border-color: #1f55d6;
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px rgba(31, 85, 214, .12);
}

.spo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.spo-head span {
  color: var(--navy, #001b4d);
  font-size: 15px;
  font-weight: 800;
}

.spo-head strong {
  padding: 3px 8px;
  border-radius: 999px;
  background: #eaf1ff;
  color: #1f55d6;
  font-size: 11px;
}

.salary-plan-option p {
  min-height: 18px;
  margin: 0;
  color: var(--text-muted, #60718a);
  font-size: 12px;
}

.spo-money {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e6edf7;
}

.spo-money span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #516276;
  font-size: 12px;
}

.spo-money strong {
  color: var(--navy, #001b4d);
  font-size: 14px;
  font-weight: 800;
}

.salary-plan-select {
  width: 100%;
  margin-top: 0;
  padding: 8px 10px;
  border-radius: 8px;
}

.salary-plan-option.selected .salary-plan-select {
  border-color: #d5e1f5;
  background: #e8eefb;
  color: #43536a;
}

.salary-rule-details {
  border: 1px solid #dfe8f5;
  border-radius: 10px;
  background: rgba(255, 255, 255, .68);
  color: #38485c;
  font-size: 12px;
}

.salary-rule-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--navy, #001b4d);
  font-weight: 800;
}

.salary-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.salary-rule-grid div {
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #edf2fa;
}

.salary-rule-grid strong {
  color: var(--navy, #001b4d);
}

.salary-rule-grid p {
  margin: 5px 0 0;
  line-height: 1.55;
  color: #53657a;
}

.salary-choice-head.compact {
  align-items: center;
}

.salary-choice-head.compact::after {
  content: none;
}

.salary-plan-section {
  display: grid;
  gap: 10px;
}

.salary-plan-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--navy, #001b4d);
  font-size: 13px;
}

.salary-plan-section-head span {
  color: #1746a2;
  background: #f4f8ff;
  border: 1px solid #bfd4ff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.salary-rule-main {
  order: 1;
}

.salary-scenario-wrap {
  padding: 0 12px 12px;
}

.salary-scenario-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #e6edf7;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.salary-scenario-table th,
.salary-scenario-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf2fa;
  text-align: right;
  white-space: nowrap;
}

.salary-scenario-table th:first-child,
.salary-scenario-table td:first-child {
  text-align: left;
}

.salary-scenario-table th {
  color: #516276;
  background: #f6f9fd;
  font-weight: 800;
}

.salary-scenario-table tr:last-child td {
  border-bottom: 0;
}

.salary-scenario-table tr.current td {
  background: #eef5ff;
  color: var(--navy, #001b4d);
  font-weight: 800;
}

.salary-scenario-table em {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #dce9ff;
  color: #1746a2;
  font-style: normal;
  font-size: 10px;
}

.salary-scenario-table small {
  display: block;
  margin-top: 2px;
  color: #60718a;
  font-size: 10px;
  font-weight: 600;
}

.salary-reason-details {
  padding-top: 0;
  color: #38485c;
}

.salary-reason-details summary {
  padding: 10px 12px;
  font-size: 12px;
}

.salary-reason-details p {
  margin: 0;
  padding: 0 12px 12px;
  line-height: 1.6;
}

.salary-flow-card {
  gap: 12px;
}

.salary-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line, #d8e2f0);
}

.salary-flow-head > div {
  display: grid;
  gap: 4px;
}

.salary-flow-head strong {
  color: var(--navy, #001b4d);
  font-size: 18px;
  font-weight: 900;
}

.salary-flow-head > span {
  flex: 0 0 auto;
  max-width: 320px;
  padding: 7px 10px;
  border: 1px solid #bfd4ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: #1746a2;
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.salary-rule-visible {
  padding: 0;
}

.salary-scenario-visible {
  padding: 0;
}

.salary-current-result {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #cfe0fb;
  border-radius: 10px;
  background: linear-gradient(135deg, #f6f9ff, #fff);
}

.salary-current-result span {
  color: #516276;
  font-size: 12px;
  font-weight: 800;
}

.salary-current-result strong {
  color: var(--navy, #001b4d);
  font-size: 22px;
  font-weight: 900;
}

.salary-current-result small {
  color: #60718a;
  font-size: 12px;
  line-height: 1.45;
}

.summary-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 13px 14px;
  box-shadow: 0 6px 18px rgba(18,38,63,.05);
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 6px;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.summary-card:has(.salary-help:hover),
.summary-card:has(.salary-help:focus) {
  z-index: 50;
}

.detail-table-card,
.this-month-panel,
.panel {
  overflow: visible;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blue);
}

.summary-card.green::before { background: var(--green); }
.summary-card.pink::before { background: #ec5b7b; }
.summary-card.navy::before { background: var(--navy); }

.meeting-checklist {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #dfe8f5;
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8ff 100%);
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 벤치마크 숨기고 메모가 패널 전체 차지 */
.memo-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  grid-column: 1 / -1;
}
.meeting-checklist--full {
  margin-top: 0;
  flex: 1;
  min-height: 300px;
  width: 100%;
  box-sizing: border-box;
}
.meeting-checklist--full #meetingNoteText {
  min-height: 240px;
}

.meeting-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.meeting-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid #e5edf8;
}

.meeting-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.meeting-row strong {
  color: var(--navy);
  font-size: 16px;
  font-weight: 800;
}

.meeting-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.meeting-note-editor {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
  flex: 1;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.meeting-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.meeting-note-head strong {
  color: var(--text);
  font-size: 13px;
}

.meeting-note-head span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

#meetingNoteText {
  width: 100%;
  flex: 1;
  min-height: 80px;
  height: auto !important;
  max-height: none !important;
  resize: none;
  border: 1px solid #d8e3f1;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}

#meetingNoteText:focus {
  outline: 2px solid rgba(31,85,214,.14);
  border-color: var(--blue);
}

#meetingNoteSave {
  margin-top: 7px;
  width: 100%;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

#meetingNoteSave:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.summary-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-value {
  color: var(--navy);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.summary-value .sv-main {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

.summary-value .sv-proj {
  color: #7a94c1;
  font-weight: 700;
}

.summary-value .sv-sep {
  font-size: 20px;
  font-weight: 400;
  color: var(--muted);
  margin: 0 2px;
}

.summary-value .sv-proj-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}

.summary-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-diff {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.summary-diff.up { color: var(--green); }
.summary-diff.down { color: var(--red); }

.this-month-panel .summary-card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.this-month-panel .summary-card-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.this-month-panel .summary-card {
  min-height: 92px;
}

.this-month-panel .summary-value {
  font-size: 25px;
}

.this-month-panel .summary-sub {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.this-month-panel .person-detail-table {
  table-layout: fixed;
}

.this-month-panel .person-detail-table th,
.this-month-panel .person-detail-table td {
  padding-left: 9px;
  padding-right: 9px;
}

.detail-table-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(18,38,63,.05);
  overflow: hidden;
}

.person-detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.person-detail-table th,
.person-detail-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: middle;
  white-space: normal;
}

.person-detail-table th {
  background: #f7faff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.person-detail-table td {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.person-detail-table tr:last-child td {
  border-bottom: 0;
}

.person-detail-table td strong {
  display: block;
  color: var(--navy);
  font-size: 17px;
  font-weight: 800;
  margin-right: 0;
  white-space: nowrap;
}

.person-detail-table td em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  margin-top: 2px;
  white-space: nowrap;
}

.person-detail-table td em.up { color: var(--green); }
.person-detail-table td em.down { color: var(--red); }

.tiktok-col {
  background: #fff8f0;
  color: #b84800;
}
.person-detail-table th.tiktok-col {
  background: #fff0e0;
  color: #b84800;
  font-weight: 700;
}
.person-detail-table td.tiktok-col strong {
  color: #c05200;
  font-size: 12px;
}

.media-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .summary-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .person-detail-table {
    table-layout: auto;
  }
}

.locked .app {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.auth-tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.auth-tools span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
  white-space: nowrap;
}

.auth-tools button {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
}

.login-screen,
.login-overlay,
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(240, 245, 252, .84);
  backdrop-filter: blur(6px);
}

.login-card,
.auth-modal-card {
  width: min(420px, 100%);
  border: 1px solid #d6e2f2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(10, 30, 70, .18);
  padding: 28px;
}

.login-card img {
  width: 132px;
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.login-card h2,
.auth-modal-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.25;
}

.login-card p,
.auth-modal-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-card label,
.auth-modal-card label {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-card input,
.auth-modal-card input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 12px;
  border: 1px solid #d6e2f2;
  border-radius: 8px;
  color: var(--text);
  background: #f9fbff;
}

.login-card button,
.auth-modal-card button {
  width: 100%;
  margin-top: 14px;
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}

.login-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.modal-actions button:first-child {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.auth-modal-card-wide {
  width: min(560px, 100%);
}

.user-reset-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

.user-reset-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: #f9fbff;
}

.user-reset-row strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.user-reset-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.user-reset-row button {
  width: auto;
  margin-top: 0;
  padding: 8px 10px;
  white-space: nowrap;
}

.car-ad-panel {
  margin: 14px 0;
}

.car-ad-summary {
  display: grid;
  gap: 12px;
}

.car-ad-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.car-ad-rank {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbe6f4;
  border-radius: 9px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f8ff 100%);
}

.car-ad-rank span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.car-ad-rank strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 14px;
}

.car-ad-rank em {
  color: var(--navy);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.car-ad-table {
  display: grid;
  overflow: hidden;
  border: 1px solid #dbe6f4;
  border-radius: 9px;
  background: #fff;
}

.car-ad-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(120px, 1fr) 72px 52px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
}

.car-ad-row:last-child {
  border-bottom: 0;
}

.car-ad-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.car-ad-bar {
  height: 8px;
  border-radius: 99px;
  background: #edf3fb;
  overflow: hidden;
}

.car-ad-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f55d6, #18a999);
}

.car-ad-count {
  color: var(--navy);
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.car-ad-rate {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .car-ad-top {
    grid-template-columns: 1fr;
  }

  .car-ad-row {
    grid-template-columns: 1fr 70px;
  }

  .car-ad-bar,
  .car-ad-rate {
    display: none;
  }
}

.kpi-grid {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.team-now-kpi {
  min-height: 112px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.team-now-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #dbe7f7;
}

.team-now-kpi.primary::before { background: var(--navy); }
.team-now-kpi.accent::before { background: #18a999; }
.team-now-kpi.salary::before { background: #ef5b7c; }

.team-now-kpi span {
  display: block;
  font-weight: 800;
  white-space: nowrap;
}

.team-now-kpi strong {
  margin: 10px 0 6px;
  font-size: 26px;
  letter-spacing: 0;
  white-space: nowrap;
}

.team-now-kpi small {
  line-height: 1.35;
  word-break: keep-all;
}

.owner-grid .panel-head h3 {
  font-size: 22px;
}

.owner-grid .table-wrap {
  max-height: 560px;
}

.owner-grid table {
  table-layout: fixed;
  font-size: 13px;
}

.owner-grid th,
.owner-grid td {
  padding: 12px 10px;
  vertical-align: middle;
}

.owner-grid th:nth-child(1),
.owner-grid td:nth-child(1) { width: 84px; }
.owner-grid th:nth-child(2),
.owner-grid td:nth-child(2) { width: 178px; }
.owner-grid th:nth-child(3),
.owner-grid td:nth-child(3) { width: 130px; }
.owner-grid th:nth-child(4),
.owner-grid td:nth-child(4),
.owner-grid th:nth-child(5),
.owner-grid td:nth-child(5) { width: 112px; }
.owner-grid th:nth-child(6),
.owner-grid td:nth-child(6) { width: 130px; }
.owner-grid th:nth-child(7),
.owner-grid td:nth-child(7) { width: 126px; }
.owner-grid th:nth-child(8),
.owner-grid td:nth-child(8) { width: 132px; }

.owner-name {
  display: block;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}

.metric-main {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.metric-main em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.metric-main em.up,
.metric-sub.up {
  color: var(--green);
}

.metric-main em.down,
.metric-sub.down {
  color: var(--red);
}

.metric-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.db-chip-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 7px;
}

.db-chip-row span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid #dfe8f5;
  border-radius: 6px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.db-chip-row b {
  color: var(--text);
  font-size: 12px;
}

.main-grid {
  grid-template-columns: 1fr;
}

.monthly-history {
  display: block;
  height: auto;
  min-height: 0;
  overflow: auto;
  padding: 0;
  border: 1px solid #e2e9f3;
  border-radius: 8px;
  background: #fff;
}

.monthly-history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.monthly-history-table th,
.monthly-history-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e7edf6;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.monthly-history-table th {
  color: #52647d;
  background: #f6f9fd;
  font-weight: 800;
}

.monthly-history-table th:first-child,
.monthly-history-table td:first-child {
  text-align: left;
  width: 118px;
}

.monthly-history-table th:nth-child(5),
.monthly-history-table td:nth-child(5) {
  width: 220px;
}

.monthly-history-table td strong {
  color: var(--navy);
  font-size: 16px;
}

.monthly-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.work-split {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 2px;
}

.work-split strong {
  line-height: 1.05;
}

.work-split span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app {
    padding: 12px;
  }

  #loadingText {
    font-size: 1rem;
    padding: 0 16px;
    text-align: center;
  }

  /* 상단 헤더 */
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .brand img {
    width: 90px;
    height: auto;
  }

  .brand h1 {
    font-size: 18px;
  }

  .auth-tools {
    flex-wrap: wrap;
    gap: 4px;
  }

  .auth-tools button {
    padding: 6px 8px;
    font-size: 11px;
  }

  /* 탭/컨트롤 */
  .tabs {
    flex-wrap: wrap;
  }

  .sub-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sub-bar .controls {
    margin-left: 0;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .person-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .person-filter select {
    min-width: 0;
    width: 100%;
  }

  /* KPI 그리드 */
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 요약 카드 */
  .summary-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* stat-cards 레이아웃 */
  .stat-cards-row,
  .stat-cards-row.has-projection {
    grid-template-columns: 1fr;
  }

  .stat-cards-right {
    grid-template-columns: 1fr;
  }

  /* person 그리드들 */
  .person-lower-grid,
  .person-bottom-grid,
  .person-work-grid {
    grid-template-columns: 1fr;
  }

  /* this-month 패널 */
  .this-month-panel .stat-cards-row.has-projection {
    grid-template-columns: 1fr;
    grid-template-areas:
      "db"
      "proj"
      "right";
  }

  .this-month-panel .stat-cards-right {
    grid-template-columns: 1fr;
  }

  /* 콘텐츠 상세 */
  .content-stat-row {
    flex-direction: column;
  }

  /* brief 카드 */
  .brief-card {
    flex-direction: column;
    padding: 14px;
  }

  .brief-card h2 {
    font-size: 18px;
  }

  /* 차량/광고 패널 */
  .car-ad-top {
    grid-template-columns: 1fr;
  }

  .car-ad-row {
    grid-template-columns: 1fr 70px;
  }

  .car-ad-bar,
  .car-ad-rate {
    display: none;
  }

  /* 표 가로 스크롤 */
  .panel,
  .detail-table-card,
  .monthly-history {
    overflow-x: auto;
  }

  .table-wrap {
    overflow-x: auto;
    max-height: none;
  }

  .monthly-history {
    overflow-x: auto;
  }

  /* panel overflow 해제 - 자식 테이블 스크롤 허용 */
  .panel,
  .detail-table-card,
  .this-month-panel {
    overflow: hidden !important;
  }

  /* 월별 급여/DB/단가 표 - min-width 해제 후 전체 컬럼 한 화면에 */
  #salaryHistoryTable {
    min-width: 0 !important;
    width: 100%;
    table-layout: auto;
    font-size: 12px;
  }

  #salaryHistoryTable th,
  #salaryHistoryTable td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  /* person 상세 표 가로 스크롤 래퍼 */
  .this-month-panel {
    overflow-x: auto;
  }

  .detail-table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .person-detail-table {
    min-width: 480px;
  }

  .person-detail-table th,
  .person-detail-table td {
    white-space: nowrap;
    font-size: 11px;
    padding: 7px 8px;
  }

  /* owner 팀전체 표 */
  .owner-grid .table-wrap table {
    min-width: 480px;
  }

  .owner-grid table {
    font-size: 12px;
  }

  /* 모바일: summary-card-grid 3칸 → 1열로 */
  .summary-card-grid-3 {
    grid-template-columns: 1fr !important;
  }

  .this-month-panel .summary-card-grid-3 {
    grid-template-columns: 1fr !important;
  }

  /* 모바일: summary-card-grid 2칸도 1열 */
  .summary-card-grid {
    grid-template-columns: 1fr !important;
  }

  /* 월별 성과 흐름 표 텍스트 겹침 방지 */
  .monthly-history {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .monthly-history-table {
    min-width: 520px;
    width: 100%;
  }

  .monthly-history-table td,
  .monthly-history-table th {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px 6px;
    vertical-align: middle;
  }

  .monthly-history-table .monthly-sub,
  .monthly-history-table .work-split span {
    display: none;
  }

  /* 인센티브 카드 시나리오 테이블 */
  .salary-scenario-wrap {
    padding: 0 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .salary-scenario-table {
    min-width: 380px;
    font-size: 11px;
  }

  .salary-scenario-table th,
  .salary-scenario-table td {
    padding: 7px 8px;
  }

  /* 인센티브 유형 헤더 설명 텍스트 줄바꿈 허용 */
  .salary-choice-head {
    flex-direction: column;
    align-items: flex-start;
  }

  /* 플랜 선택 그리드 → 1열 */
  .salary-plan-grid {
    grid-template-columns: 1fr;
  }

  /* 인센티브 구조 설명 2열 → 1열 */
  .salary-incentive-type {
    flex-direction: column;
    gap: 6px;
  }

  /* 락 날짜 텍스트 줄바꿈 허용 */
  .sci-lock-info {
    white-space: normal;
    line-height: 1.5;
  }
}

/* Team forecast summary overrides */
.kpi-grid {
  display: block;
}

.forecast-hero {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.forecast-hero .kpi {
  min-height: 154px;
  padding: 22px 20px;
}

.forecast-hero .kpi span {
  font-size: 14px;
  font-weight: 800;
}

.forecast-hero .kpi strong {
  font-size: 34px;
  letter-spacing: 0;
}

.current-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.current-kpi-strip .kpi {
  min-height: 116px;
  padding: 16px;
}

.current-kpi-strip .kpi strong {
  font-size: 24px;
}

.owner-summary-row {
  cursor: pointer;
}

.owner-summary-row:hover td {
  background: #f8fbff;
}

.owner-summary-row.open td {
  background: #f5f9ff;
}

.owner-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 7px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 800;
}

.owner-summary-row.open .owner-toggle {
  background: #1e3a8a;
  color: #fff;
}

.owner-detail-row td {
  padding: 0 16px 16px !important;
  background: #f8fbff;
}

.owner-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #d7e3f3;
  border-radius: 8px;
  background: #fff;
}

.owner-detail-panel h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.owner-detail-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.owner-history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.owner-history-table th,
.owner-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8eef7;
  text-align: right;
  white-space: nowrap;
}

.owner-history-table th:first-child,
.owner-history-table td:first-child {
  text-align: left;
}

.owner-history-table span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.owner-detail-empty {
  padding: 16px;
  border: 1px solid #d7e3f3;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

@media (max-width: 1100px) {
  .forecast-hero,
  .current-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .owner-detail-panel {
    padding: 12px;
  }
}

/* Team owner table: keep metrics readable without overlap */
.owner-grid .table-wrap {
  overflow: auto;
}

.owner-grid .table-wrap table {
  min-width: 1320px;
  table-layout: fixed;
}

.owner-grid th,
.owner-grid td {
  padding: 14px 10px;
  vertical-align: middle;
}

.owner-grid th:nth-child(1),
.owner-grid td:nth-child(1) {
  width: 130px;
  text-align: left;
}

.owner-grid th:nth-child(2),
.owner-grid td:nth-child(2),
.owner-grid th:nth-child(3),
.owner-grid td:nth-child(3),
.owner-grid th:nth-child(4),
.owner-grid td:nth-child(4) {
  width: 118px;
}

.owner-grid th:nth-child(5),
.owner-grid td:nth-child(5) {
  width: 178px;
}

.owner-grid th:nth-child(6),
.owner-grid td:nth-child(6) {
  width: 130px;
}

.owner-grid th:nth-child(7),
.owner-grid td:nth-child(7),
.owner-grid th:nth-child(8),
.owner-grid td:nth-child(8) {
  width: 118px;
}

.owner-grid th:nth-child(9),
.owner-grid td:nth-child(9) {
  width: 145px;
}

.owner-grid .metric-main {
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  line-height: 1.25;
  white-space: normal;
}

.owner-grid .metric-main em {
  white-space: nowrap;
}

.owner-grid .metric-sub {
  text-align: center;
  white-space: normal;
  line-height: 1.35;
}

.owner-grid .db-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.owner-grid .db-chip-row span {
  min-width: 48px;
  justify-content: center;
  padding: 4px 6px;
  white-space: nowrap;
}

.owner-grid .owner-name {
  display: block;
  line-height: 1.3;
}

.owner-grid .owner-toggle {
  min-width: 58px;
}

/* ── 급여 확정 패널 ─────────────────────────────────────── */
.salary-confirm-panel {
  margin-top: 0;
}

.scp-body {
  padding: 0 2px;
}

.scp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.scp-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #60718a);
  border-bottom: 2px solid var(--line, #d8e2f0);
  white-space: nowrap;
}

.scp-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #d8e2f0);
  font-size: 14px;
  color: var(--navy);
}

.scp-table tbody tr:hover td {
  background: #f8fbff;
}

.scp-name {
  font-weight: 700;
}

.scp-input {
  width: 90px;
  padding: 5px 8px;
  border: 1px solid var(--line, #d8e2f0);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  text-align: right;
  outline: none;
  transition: border-color 0.15s;
}

.scp-input:focus {
  border-color: var(--blue, #1f55d6);
  box-shadow: 0 0 0 3px rgba(31,85,214,0.1);
}

.scp-input:disabled {
  background: #f2f6fb;
  color: var(--text-muted, #60718a);
  cursor: not-allowed;
}

.scp-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 16px 4px 4px;
}

.scp-hint {
  font-size: 12px;
  color: var(--text-muted, #60718a);
}

.scp-btn {
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
}

.scp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.scp-btn-confirm {
  background: var(--navy, #071b3a);
  color: #fff;
}

.scp-btn-confirm:hover:not(:disabled) {
  background: #0f2d60;
}

.scp-btn-reset {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line, #d8e2f0);
}

.scp-btn-reset:hover {
  border-color: var(--navy);
}

.scp-confirmed-badge {
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
  padding: 6px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
}

/* 틱톡 DB 미수집 표시 — 실제 0건과 구분 */
.tiktok-unsynced {
  color: #94a3b8;
  font-weight: 500;
  font-style: italic;
  border-bottom: 1px dotted #cbd5e1;
  cursor: help;
}

/* 사전계약 DB 내역 */
.pre-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pre-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: #eef2f8; color: #45566e; font-size: 12px; font-weight: 600;
}
.pre-chip b { color: #17233a; }
.pre-chip.good { background: #e6f6ec; color: #1c7a42; }
.pre-chip.good b { color: #146032; }
.pre-chip.warn { background: #fff4e2; color: #a45a05; }
.pre-chip.warn b { color: #85490a; }
.pre-chip.bad { background: #fdecec; color: #b23434; }
.pre-chip.bad b { color: #8f2727; }

.pre-table-wrap { overflow-x: auto; }
.pre-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pre-table th, .pre-table td {
  padding: 9px 10px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid #eef1f6;
}
.pre-table th { background: #f6f8fc; color: #5a6b82; font-weight: 600; font-size: 12px; }
.pre-table tbody tr:hover { background: #fafcff; }
.pre-table .pre-date { color: #6b7c93; font-variant-numeric: tabular-nums; }
.pre-table .pre-phone { font-variant-numeric: tabular-nums; }
.pre-table .pre-kw {
  max-width: 230px; overflow: hidden; text-overflow: ellipsis;
  color: #5a6b82; font-size: 12px;
}
.pre-status {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  background: #eef2f8; color: #45566e; font-size: 12px; font-weight: 600;
}
.pre-status.good { background: #e6f6ec; color: #1c7a42; }
.pre-status.warn { background: #fff4e2; color: #a45a05; }
.pre-status.bad { background: #fdecec; color: #b23434; }

/* 실지급 급여 카드 — 인센티브 추정치와 구분 */
.salary-card-actual .salary-title { display: flex; align-items: center; gap: 7px; }
.salary-carried {
  font-style: normal; font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px;
  background: #fff4e2; color: #a45a05;
}
.salary-actual-note { margin-top: 10px; font-size: 12px; color: #5a6b82; }
.salary-actual-sub { margin-top: 4px; font-size: 12px; color: #8494a8; }


/* 진행불가 행 — 같은 표 안에서 구분만 */
.pre-row-blocked td { color: #9aa5b3; background: #fdf8f8; }
.pre-blocked-tag {
  margin-left: 7px; padding: 1px 6px; border-radius: 5px;
  background: #fdecec; color: #b23434;
  font-size: 11px; font-weight: 700; vertical-align: middle;
}

/* 성과 대시보드 → 연차 관리 이동 링크 (auth-tools 버튼과 같은 모양) */
.auth-link-btn {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3ff;
  color: #1f55d6;
  text-decoration: none;
  white-space: nowrap;
}
.auth-link-btn:hover { background: #1f55d6; color: #fff; }
@media (max-width: 720px) { .auth-link-btn { padding: 6px 8px; font-size: 11px; } }

/* 코드 유입 DB — 사이트 구분 태그 */
.pre-kind { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.pre-kind.pre { background: #eaf0fd; color: #1f55d6; }
.pre-kind.gen { background: #e6f6ec; color: #1c7a42; }
.pre-site { margin-left: 5px; font-size: 12px; color: #6b7c93; }
