/* ============================================================
   R&D빌더스 관리자 — 공용 셸
   구조 출처: 50.jangkokjin_kefalab/admin/admin.css (사이드바 + 상단바 + 콘텐츠)
   배색은 본 사이트 토큰(assets/tokens.css)에서 가져온다.

   인라인 style="" 속성을 쓰지 않는다. CSP 가 style-src 'self' 라
   속성 스타일은 조용히 무시된다 — 폭·여백은 전부 여기서 정한다.
   ============================================================ */

:root {
  /* 네이비 (사이드바·헤딩) */
  --navy-700: #1e355c;
  --navy-800: #12294d;
  --navy-900: #0b1b36;
  /* 슬레이트 (텍스트·보더) */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #f7f8fa;
  --border: #e2e6ec;
  --border-strong: #c9cfd9;
  --border-soft: #eef0f4;
  --text: #141821;
  --text-sub: #434c5c;
  --text-muted: #687186;
  /* 액센트 */
  --accent: #d9530f; /* 전환·강조 버튼 */
  --accent-text: #b4430c; /* 오렌지 글자 (5.60:1) */
  --cyan: #74c6de; /* 로고 계승 — 활성 표시 */
  --success: #1f7a4d;
  --success-bg: #eaf3ee;
  --warning: #8a5a00;
  --warning-bg: #fbf3e0;
  --danger: #b4432e;
  --danger-bg: #faedea;
  /* 치수 */
  --sb-w: 232px;
  --tb-h: 58px;
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;
  --shadow-1: 0 1px 2px rgba(20, 24, 33, 0.06);
  --shadow-2: 0 12px 30px rgba(11, 27, 54, 0.18);
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}

.admin-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  /* 관리자에는 웹폰트를 싣지 않는다. 내부 화면 한 장 때문에 419KB 를
     받게 하지 않는다 — 설치돼 있으면 쓰고 없으면 시스템 폰트로 간다. */
  font-family:
    "Pretendard Variable",
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    system-ui,
    "Malgun Gothic",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy-800);
}

/* 보조기기에만 읽히는 라벨. placeholder 만으로는 라벨이 되지 않는다 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ========== 사이드바 ========== */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sb-w);
  height: 100vh;
  background: var(--navy-800);
  color: #c3cfe0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 0.2s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
}
.sidebar-brand-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}
.sidebar-brand-text small {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.22em;
  color: #8da2c4;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  color: #c3cfe0;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 140ms,
    color 140ms;
}
.sidebar-link:hover {
  background: var(--navy-700);
  color: #fff;
}
.sidebar-link.active {
  background: var(--navy-700);
  color: #fff;
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--cyan);
}
.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.8;
}
.sidebar-link.active svg {
  opacity: 1;
  color: var(--cyan);
}
.sidebar-link .count {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-sitelink {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-sm);
  color: #c3cfe0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background 140ms,
    color 140ms,
    border-color 140ms;
}
.sidebar-sitelink:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.sidebar-foot-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-who {
  flex: 1;
  min-width: 0;
}
.sidebar-who b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.sidebar-who span {
  display: block;
  font-size: 11px;
  color: #8da2c4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout {
  flex: none;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-sm);
  background: none;
  color: #c3cfe0;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition:
    background 140ms,
    color 140ms,
    border-color 140ms;
}
.sidebar-logout:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* ========== 레이아웃 ========== */
.admin-layout {
  margin-left: var(--sb-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--tb-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.admin-topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.session-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.session-left .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.session-left.warn .dot {
  background: var(--accent);
}
.topbar-mark {
  display: none;
  width: 24px;
  height: 24px;
  flex: none;
}

/* ========== 모바일 하단 GNB ==========
   PC 에서는 왼쪽 사이드바가 메뉴다. 좁아지면 사이드바를 내리고
   본 사이트와 같은 자리(하단)에 GNB 를 올린다. 햄버거 드로어는 두지 않는다 —
   메뉴로 가는 입구가 둘이 되고 한 번 더 눌러야 한다. */
.admin-gnb,
.admin-sheet {
  display: none;
}

.admin-content {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  padding: 24px 26px 96px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.page-head h2 {
  margin: 0 0 3px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-head p {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
}

/* ========== 블록 ========== */
.block {
  margin-bottom: 22px;
}
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.block-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.block-head h3 span {
  font-weight: 400;
  color: var(--text-muted);
}
.block-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
  white-space: nowrap;
}
.block-link:hover {
  text-decoration: underline;
}

/* ========== KPI ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.kpi {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}
.kpi-value {
  margin-top: 2px;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-foot {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.kpi.hot .kpi-value {
  color: var(--accent-text);
}

/* ========== 바로가기 카드 ========== */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.link-card {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 140ms,
    box-shadow 140ms,
    transform 140ms;
}
.link-card:hover {
  border-color: var(--navy-700);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}
.link-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.link-card-head b {
  font-size: 14px;
  font-weight: 700;
}
.link-card-head span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.link-card p {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ========== 툴바 ========== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.toolbar label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
}
.toolbar .grow {
  flex: 1;
  min-width: 180px;
}
.toolbar .spacer {
  margin-left: auto;
}
.toolbar .hint {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
select {
  width: auto;
  min-width: 128px;
}
textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.6;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
  border-color: var(--navy-700);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 140ms,
    border-color 140ms,
    color 140ms;
}
.btn:hover:not(:disabled) {
  border-color: var(--text-muted);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--navy-900);
  border-color: var(--navy-900);
}
/* 오렌지 채움 + 흰 글씨는 전환 CTA 전용이다. 관리자에는 전환이 없으므로
   여기서는 파괴적 동작(해지·세션 종료)에만 테두리로 쓴다. */
.btn-danger {
  color: var(--danger);
  border-color: #e6c4bc;
  background: var(--danger-bg);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* ========== 표 ========== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 11px 13px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
}
th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr.clickable {
  cursor: pointer;
}
tbody tr.clickable:hover {
  background: var(--surface-alt);
}
.col-when {
  width: 118px;
}
.col-status {
  width: 132px;
}
.col-act {
  width: 96px;
}
.nowrap {
  white-space: nowrap;
}
.num {
  font-variant-numeric: tabular-nums;
}
.sub {
  color: var(--text-muted);
  font-size: 12px;
}
.strong {
  font-weight: 700;
}
.empty {
  padding: 44px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ========== 태그·배지 ========== */
.tag {
  display: inline-block;
  margin: 1px 3px 1px 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--border-soft);
  color: var(--text-sub);
  font-size: 11px;
}
.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.pill-new {
  background: #fde3d3;
  color: var(--accent-text);
}
.pill-contacted {
  background: #e4eaf3;
  color: var(--navy-800);
}
.pill-qualified {
  background: var(--warning-bg);
  color: var(--warning);
}
.pill-won {
  background: var(--success-bg);
  color: var(--success);
}
.pill-dropped,
.pill-unsubscribed,
.pill-bounced {
  background: var(--border-soft);
  color: var(--text-muted);
}
.pill-suspect {
  background: var(--danger-bg);
  color: var(--danger);
}
.pill-active {
  background: var(--success-bg);
  color: var(--success);
}

/* ============================================================
   통계 화면 (유입통계 · Meta 광고)

   차트에 SVG <text> 를 쓰지 않는다. 뷰박스가 컨테이너 폭에 맞춰 줄면
   글자까지 같이 눌려 좁은 화면에서 9px 로 렌더된다. 막대는 div,
   글자는 HTML 로 그린다 — 길이만 JS 가 CSSOM 으로 넣는다.
   ============================================================ */

.range-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.range-tabs button {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-sub);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.range-tabs button.on {
  background: var(--navy-800);
  color: #fff;
}

.panel {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.panel h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
}
.panel h4 em {
  font-style: normal;
  font-weight: 400;
  color: var(--text-muted);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

/* KPI 증감 */
.delta {
  display: inline-block;
  margin-left: 5px;
  font-size: 12px;
  font-weight: 700;
}
.delta.up {
  color: var(--success);
}
.delta.down {
  color: var(--danger);
}
.delta.flat {
  color: var(--text-muted);
}

/* 가로 막대 목록 */
.bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 4열이다 — 라벨 · 막대 · 값 · 보조수치(전환율).
   3열로 두면 보조수치가 있는 줄만 다음 행으로 밀려 표가 어긋난다.
   보조수치가 없는 줄은 auto 가 0 폭이라 아무 자리도 차지하지 않는다. */
.bar-row {
  display: grid;
  grid-template-columns: minmax(64px, 26%) 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.bar-row .bl {
  color: var(--text-sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--navy-800);
  width: 0;
}
.bar-fill.alt {
  background: var(--cyan);
}
.bar-fill.warm {
  background: var(--accent);
}
.bar-row .bv {
  min-width: 46px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bar-row .bx {
  min-width: 42px;
  text-align: right;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 세로 막대 (일별·시간대별) */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 132px;
  padding-top: 6px;
}
.spark .col {
  flex: 1;
  min-width: 3px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  gap: 1px;
}
.spark .v {
  display: block;
  width: 100%;
  border-radius: 2px 2px 0 0;
  background: var(--navy-800);
  height: 0;
}
.spark .v.b {
  background: var(--cyan);
}
.spark .v.z {
  height: 2px;
  background: var(--border);
}
.spark-x {
  display: flex;
  gap: 2px;
  margin-top: 5px;
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.spark-x span {
  flex: 1;
  min-width: 3px;
  text-align: center;
  overflow: hidden;
  /* 눈금이 두 줄로 접히면 차트 아래가 들쭉날쭉해진다 */
  white-space: nowrap;
}
.legend {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 4px;
  border-radius: 2px;
  vertical-align: -1px;
}
.legend i.a {
  background: var(--navy-800);
}
.legend i.b {
  background: var(--cyan);
}

/* 퍼널 */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.funnel-bar {
  height: 26px;
  border-radius: var(--r-sm);
  background: var(--border-soft);
  overflow: hidden;
}
.funnel-fill {
  display: block;
  height: 100%;
  background: var(--navy-800);
  width: 0;
}
.funnel-row:nth-child(2) .funnel-fill {
  background: var(--navy-700);
}
.funnel-row:nth-child(3) .funnel-fill {
  background: #46618f;
}
.funnel-row:nth-child(4) .funnel-fill {
  background: var(--cyan);
}
.funnel-row:nth-child(5) .funnel-fill {
  background: var(--success);
}
.funnel-row .fv {
  min-width: 76px;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 안내 박스 */
.notice {
  padding: 16px 18px;
  border: 1px dashed var(--border-strong, #c9cfd9);
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  color: var(--text-sub);
  font-size: 13px;
}
.notice b {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 14px;
}
.notice code {
  display: inline-block;
  margin: 3px 4px 0 0;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--border-soft);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}
.notice.bad {
  border-color: #e6c4bc;
  border-style: solid;
  background: var(--danger-bg);
  color: var(--danger);
}

/* 운영 판단 */
.reads {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-sub);
}
.reads li + li {
  margin-top: 4px;
}
.reads b {
  color: var(--text);
}

.stamp {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   업무관리 — 달력 히트맵 + 날짜별 카드
   ============================================================ */

.toolbar-tight {
  margin-bottom: 0;
  padding: 8px 10px;
}
.toolbar-tight input {
  width: auto;
  min-width: 132px;
}

.works-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-head b {
  font-size: 15px;
}
.cal-legend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.cal-legend i {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 3px;
}
.cal-issue-key {
  margin-left: 6px;
}
.cal-issue-key .dot,
.cal-cell .issue {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.cal-dows {
  margin-bottom: 5px;
}
.cal-dows span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.cal-pad {
  aspect-ratio: 1 / 1;
}
.cal-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cal-cell .d {
  font-size: 11px;
  font-weight: 700;
}
.cal-cell .n {
  position: absolute;
  right: 5px;
  bottom: 3px;
  font-size: 10px;
  font-weight: 800;
}
.cal-cell .issue {
  position: absolute;
  right: 5px;
  top: 5px;
}
.cal-cell.today {
  border-color: var(--text-muted);
}
.cal-cell.sel {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}
/* 히트맵 5단계. 색만으로 구분하지 않도록 건수를 같이 찍는다 */
.lv0 {
  background: var(--border-soft);
}
.lv1 {
  background: #c7d2e6;
}
.lv2 {
  background: #6e86b0;
  color: #fff;
}
.lv3 {
  background: #2e4770;
  color: #fff;
}
.lv4 {
  background: var(--navy-800);
  color: #fff;
}
.cal-summary {
  display: flex;
  gap: 16px;
  margin-top: 13px;
  font-size: 12px;
  color: var(--text-sub);
}

.day-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 11px;
}
.day-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}
.day-head .spacer {
  margin-left: auto;
}

.wcard {
  margin-bottom: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.wcard.issue {
  border-color: #fac6a6;
}
.wcard-body {
  padding: 13px 15px;
}
.wcard-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wcard-head .spacer {
  margin-left: auto;
}
.wcard-title {
  font-size: 14px;
  font-weight: 700;
}
.wtype {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.t-완료 {
  background: var(--success-bg);
  color: var(--success);
}
.t-진행 {
  background: #e4eaf3;
  color: var(--navy-800);
}
.t-특이사항 {
  background: var(--warning-bg);
  color: var(--warning);
}
.wcard-text {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--text-sub);
  white-space: pre-wrap;
}
.wcard-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.thread {
  padding: 11px 15px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-alt);
}
.thread .msg {
  margin-bottom: 8px;
  font-size: 13px;
}
.thread .msg b {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
}
.thread .msg p {
  margin: 2px 0 0;
  padding: 7px 11px;
  border-radius: 10px;
  border-top-left-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: pre-wrap;
}
.thread .msg .meta {
  font-size: 10px;
  color: var(--text-muted);
}
.thread-form {
  display: flex;
  gap: 7px;
}
.thread-form input {
  flex: 1;
  padding: 6px 10px;
  font-size: 13px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.field-row select,
.field-row input {
  width: 100%;
}
.modal-foot .btn-danger {
  margin-right: auto;
}

/* ============================================================
   콘텐츠 발행 — 발행물 목록
   ============================================================ */
.cpub-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.cpub-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 9px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.cpub-thumb {
  position: relative;
  flex: none;
  width: 44px;
  height: 54px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--navy-800);
}
.cpub-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cpub-thumb .noimg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  font-weight: 700;
}
.cpub-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cpub-main b {
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cpub-main .sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cpub-sub {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ============================================================
   상담신청 — 일간·주간·월간 + 날짜 그룹 2열 카드
   구조 출처: 50.jangkokjin_kefalab/admin (est-quick-stats · est-date-cards)
   ============================================================ */

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.qs-card {
  padding: 12px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.qs-label {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--border-soft);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
}
.qs-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.qs-card em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-muted);
}

.est-list {
  display: grid;
  gap: 18px;
}
.est-date-group {
  display: grid;
  gap: 8px;
}
.est-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px;
}
.est-date-head strong {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.est-date-head strong span {
  color: var(--accent-text);
}
.est-date-head > span {
  font-size: 11px;
  color: var(--text-muted);
}
/* 2열이 기본. 좁아지면 1열 — 카드를 옆으로 밀지 않는다 */
.est-date-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.est-card {
  display: grid;
  gap: 8px;
  padding: 13px 15px 13px 17px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  font: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 140ms,
    box-shadow 140ms;
}
/* 왼쪽 색띠로 상태를 표시한다. 배지만으로는 카드 더미에서 눈에 안 들어온다 */
.est-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--border-strong);
}
.est-card[data-status="new"]::before {
  background: var(--accent);
}
.est-card[data-status="contacted"]::before {
  background: var(--navy-700);
}
.est-card[data-status="qualified"]::before {
  background: var(--warning);
}
.est-card[data-status="won"]::before {
  background: var(--success);
}
.est-card[data-status="suspect"]::before {
  background: var(--danger);
}
.est-card:hover {
  border-color: var(--navy-700);
  box-shadow: var(--shadow-1);
}
.est-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.est-card-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.est-card-title b {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.est-card-info {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}
.est-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.est-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
}
.est-card-foot .go {
  margin-left: auto;
  color: var(--accent-text);
  font-weight: 600;
  white-space: nowrap;
}
.tag.memo {
  background: var(--warning-bg);
  color: var(--warning);
  font-weight: 700;
}

/* ========== 기간 선택 ========== */
.range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.range-custom {
  display: flex;
  align-items: center;
  gap: 6px;
}
.range-custom[hidden] {
  display: none;
}
.range-custom input {
  width: auto;
  padding: 6px 9px;
  font-size: 13px;
}
.range-custom .tilde {
  color: var(--text-muted);
}

/* ========== 메모 ========== */
.inline-save {
  display: flex;
  gap: 8px;
}
.memo-block {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.memo-head-row {
  margin-bottom: 9px;
  font-size: 13px;
}
.memo-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.memo {
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
}
.memo-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 12px;
}
.memo-act {
  margin-left: auto;
  display: flex;
  gap: 5px;
}
.memo-body {
  margin: 0;
  font-size: 13px;
  white-space: pre-wrap;
}
.memo-edit {
  width: 100%;
  min-height: 70px;
  margin-bottom: 7px;
}
.memo-form textarea {
  min-height: 72px;
}
.memo-form-row {
  display: flex;
  gap: 7px;
  margin-top: 7px;
}
.memo-form-row input {
  width: auto;
  flex: 1;
  max-width: 180px;
}

/* ========== 메일링 (소식지) ========== */
.ml-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.ml-tile {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.ml-k {
  font-size: 12px;
  color: var(--text-muted);
}
.ml-k small {
  font-size: 11px;
}
.ml-v {
  margin: 2px 0 4px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.ml-v small {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}
.ml-s {
  font-size: 12px;
  color: var(--text-muted);
}
/* 상한까지 얼마나 찼는지. 숫자만 두면 500 이 큰지 작은지 감이 안 온다 */
.ml-meter {
  height: 7px;
  margin: 6px 0;
  border-radius: 999px;
  background: var(--border-soft);
  overflow: hidden;
}
.ml-meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--navy-800);
}
.ml-meter i.hot {
  background: var(--danger);
}
.ml-cap-note {
  line-height: 1.65;
}
.ml-send-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
#mlBody {
  min-height: 160px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}

/* ========== 담당자 관리 ========== */
.staff-lead {
  margin: 0 0 12px;
}
.staff-form {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.staff-form input {
  width: auto;
  flex: 1;
  min-width: 130px;
}
.col-act .btn + .btn {
  margin-left: 5px;
}

/* ========== 페이저 ========== */
.pager {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 16px;
}

/* ========== 모달 ========== */
.modal[hidden] {
  display: none;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 27, 54, 0.45);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.modal-x {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-x:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.modal-body {
  padding: 18px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
}

/* 상세 정의 목록 */
.kv {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 14px;
  margin: 0 0 16px;
  font-size: 13px;
}
.kv dt {
  color: var(--text-muted);
  font-size: 12px;
  padding-top: 1px;
}
.kv dd {
  margin: 0;
  word-break: break-word;
}
.field {
  margin-bottom: 12px;
}
.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
}

/* ========== 토스트 ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 80;
  transform: translateX(-50%) translateY(16px);
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--navy-800);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms,
    transform 180ms;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  background: var(--danger);
}
.toast.success {
  background: var(--success);
}

/* ========== 로그인 ========== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--navy-800);
}
.login-card {
  width: 100%;
  max-width: 358px;
  padding: 30px 28px 26px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}
.login-brand svg {
  width: 30px;
  height: 30px;
}
.login-brand b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--navy-800);
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.login-card p {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}
.login-card .btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
}
.login-err {
  min-height: 19px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--danger);
}

/* ========== 반응형 ========== */
@media (max-width: 980px) {
  .works-grid {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    display: none;
  }
  .admin-layout {
    margin-left: 0;
  }
  .topbar-mark {
    display: block;
  }
  body.drawer-open {
    overflow: hidden;
  }

  .admin-gnb {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--navy-800);
    /* 홈 인디케이터가 있는 기기에서 마지막 줄이 잘리지 않게 */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .gnb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    /* 터치영역 44px 을 지킨다. 5칸이면 360px 에서 한 칸 72px */
    min-height: 56px;
    padding: 7px 2px;
    border: 0;
    background: none;
    color: #8da2c4;
    font: inherit;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
  }
  .gnb-item svg {
    width: 21px;
    height: 21px;
  }
  .gnb-item.active {
    color: #fff;
    box-shadow: inset 0 2px 0 var(--cyan);
  }
  .gnb-item.active svg {
    color: var(--cyan);
  }

  /* 더보기 시트 — 나머지 메뉴 */
  .admin-sheet {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 46;
    background: rgba(11, 27, 54, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s;
  }
  .admin-sheet.show {
    opacity: 1;
    pointer-events: auto;
  }
  .sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 12px calc(72px + env(safe-area-inset-bottom, 0));
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    transform: translateY(12px);
    transition: transform 0.18s;
  }
  .admin-sheet.show .sheet-panel {
    transform: translateY(0);
  }
  .sheet-grip {
    width: 38px;
    height: 4px;
    margin: 4px auto 10px;
    border-radius: 999px;
    background: var(--border-strong);
  }
  .sheet-link {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 48px;
    padding: 12px 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: none;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
  }
  .sheet-link svg {
    width: 19px;
    height: 19px;
    color: var(--text-muted);
  }
  .sheet-link.active {
    background: var(--surface-alt);
    font-weight: 700;
  }
  .sheet-link.active svg {
    color: var(--navy-800);
  }
  .sheet-link.danger {
    margin-top: 4px;
    border-top: 1px solid var(--border-soft);
    border-radius: 0;
    color: var(--danger);
  }
  .sheet-link.danger svg {
    color: var(--danger);
  }

  /* GNB 가 마지막 줄을 가리지 않게 바닥을 비운다 */
  .admin-content {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0));
  }
  .toast {
    bottom: calc(74px + env(safe-area-inset-bottom, 0));
  }
}

@media (max-width: 760px) {
  /* 카드를 옆으로 밀지 않는다. 가로스크롤 대신 한 줄에 하나 */
  .est-date-cards {
    grid-template-columns: 1fr;
  }
  .quick-stats {
    gap: 7px;
  }
  .qs-card {
    padding: 10px 11px;
  }
  .qs-card strong {
    font-size: 20px;
  }
  .range-custom {
    width: 100%;
  }
  .range-custom input {
    flex: 1;
    min-width: 0;
  }
  .admin-content {
    /* 단축속성으로 쓰면 위 980px 블록이 잡아 둔 GNB 자리까지 덮어쓴다 */
    padding-top: 18px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .admin-topbar {
    padding: 0 14px;
  }
  .session-left {
    display: none;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .kpi-value {
    font-size: 23px;
  }
  th,
  td {
    padding: 9px 10px;
    font-size: 12px;
  }
  /* iOS 는 16px 미만 입력에 자동 확대를 건다 */
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .kv {
    grid-template-columns: 78px 1fr;
  }
  /* 좁은 화면에서 접히는 열. 가로스크롤 대신 열을 줄인다 */
  .hide-s {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
  }
}

/* 입력칸 아래 붙는 한 줄 보조 문구 (소식지 제목의 (광고) 자동표기 안내 등) */
.field > .sub {
  margin-top: 6px;
  line-height: 1.6;
}

/* ── 접수 출처 배지 · 캠페인 구조 · 광고 소재 ──────────────
   전부 팔레트 토큰만 쓴다. 하드코딩 색을 섞으면 다른 화면 배지와 톤이 어긋난다. */
.src {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 800;
  vertical-align: 2px;
  white-space: nowrap;
}
.src-site {
  background: var(--surface-alt);
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.src-meta {
  background: #e6edf7;
  color: var(--navy-700);
}

/* 상태 — 색이 곧 판단이다. 게재중/중지/검토/거부 넷만 쓴다. */
.st {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.st-on {
  background: var(--success-bg);
  color: var(--success);
}
.st-off {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.st-warn {
  background: var(--warning-bg);
  color: var(--warning);
}
.st-bad {
  background: var(--danger-bg);
  color: var(--danger);
}

/* 레벨 — 색이 아니라 진하기로 깊이를 낸다. 색으로 하면 상태 배지와 싸운다. */
.lvl {
  display: inline-block;
  width: 46px;
  text-align: center;
  padding: 2px 0;
  border-radius: var(--r-sm);
  font-size: 10.5px;
  font-weight: 800;
  margin-right: 10px;
  vertical-align: 1px;
}
.lvl-c {
  background: var(--navy-800);
  color: #fff;
}
.lvl-s {
  background: #dfe6f0;
  color: var(--navy-700);
}
.lvl-a {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.bud {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.metrics {
  display: inline-flex;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.metrics b {
  color: var(--text);
  font-weight: 700;
}

/* A안 · 중첩 박스 */
.a-camp {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
  margin-bottom: 14px;
}
.a-camp__h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--navy-800);
  color: #fff;
  flex-wrap: wrap;
}
.a-camp__h b {
  font-size: 15.5px;
}
.a-camp__h .sp {
  flex: 1;
}
.a-camp__h .m {
  font-size: 13px;
  color: #c6d6ec;
  font-variant-numeric: tabular-nums;
}
.a-camp__h .bud {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: #dce6f5;
}
.a-set {
  margin: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-alt);
}
.a-set__h {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.a-set__h b {
  font-size: 14px;
  color: var(--navy-700);
}
.a-set__h .sp {
  flex: 1;
}
.a-ads {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13.5px;
}
.a-ads td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.a-ads tr:last-child td {
  border-bottom: 0;
}
.a-ads td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.a-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 광고 소재 카드 */
.cre-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.cre {
  flex: 1;
  min-width: 330px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
.cre__h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.cre__h b {
  font-size: 14.5px;
  color: var(--navy-800);
}
.cre__h .sp {
  flex: 1;
}
.cre__b {
  display: flex;
  gap: 14px;
  padding: 14px;
}
/* 비율은 소재대로. 정사각 틀에 9:16 을 우겨넣으면 릴스가 잘려 보여
   «소재가 잘못됐다» 는 오해가 생긴다. */
.cre__thumb {
  flex: none;
  width: 96px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  object-fit: cover;
  display: block;
}
.cre__thumb.sq {
  height: 96px;
}
.cre__thumb.tall {
  height: 170px;
}
.cre__x {
  flex: 1;
  min-width: 0;
}
.cre__row {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  padding: 3px 0;
}
.cre__row span:first-child {
  width: 58px;
  flex: none;
  color: var(--text-muted);
  font-weight: 700;
}
.cre__row span:last-child {
  color: var(--text-sub);
  word-break: keep-all;
}
.cre__copy {
  margin: 10px 14px 0;
  padding: 11px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-sub);
  white-space: pre-wrap;
  max-height: 96px;
  overflow: auto;
}
.cre__cards {
  margin: 10px 14px 0;
  font-size: 12.5px;
}
.cre__cards div {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed var(--border);
}
.cre__cards div:first-child {
  border-top: 0;
}
.cre__cards i {
  font-style: normal;
  color: var(--text-muted);
  font-weight: 800;
  width: 32px;
  flex: none;
}
.cre__cards b {
  color: var(--text);
  font-weight: 700;
}
.cre__cards em {
  font-style: normal;
  color: var(--text-muted);
}
.miss {
  display: inline-block;
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #e8d9b0;
  border-radius: var(--r-sm);
  padding: 1px 7px;
  font-size: 11.5px;
  font-weight: 700;
}
.cre__f {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  flex-wrap: wrap;
}
.cre__f .btn {
  text-decoration: none;
  display: inline-block;
}

/* 미리보기 — 메타 iframe 그대로 */
.prev__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 10px;
  flex-wrap: wrap;
}
.prev__head b {
  font-size: 14px;
  color: var(--navy-800);
}
.prev__tabs {
  display: flex;
  gap: 6px;
  flex: 1;
}
.prev__tab {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer;
}
.prev__tab.on {
  background: var(--navy-800);
  border-color: var(--navy-800);
  color: #fff;
}
.prev__box {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-alt);
  padding: 14px;
  min-height: 220px;
  display: flex;
  justify-content: center;
}
.prev__frame {
  width: 100%;
  max-width: 420px;
  height: 620px;
  border: 0;
  background: #fff;
  border-radius: var(--r-md);
}
.prev__wait {
  color: var(--text-muted);
  font-size: 13px;
  align-self: center;
}

/* 썸네일을 못 받았을 때. 깨진 이미지 아이콘을 보여 주느니
   비율이라도 알려 주는 편이 낫다 — «소재가 잘못됐나» 를 의심하지 않게 된다. */
.cre__thumb--none {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #16305c, #0b1b36);
  color: #8fa8cd;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  border-color: var(--navy-700);
}
