/* ===================================================================
   townfolks 챗봇 지식 관리자 — admin.css
   디자인 목업(design/admin_mockup.html) t1/t2/t3 테마를 클래스 기반으로 이식.
   폰트: Pretendard (CDN) · 아이콘: Lucide (CDN, data-lucide).
   인라인 스타일 목업 → 재사용 가능한 클래스 컴포넌트로 정리(시각 충실).
   =================================================================== */

/* ---------- 0. 리셋 / 기본 ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
}
textarea, input, select, button { font-family: inherit; }
textarea { resize: vertical; }
a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: rgba(120,110,95,.26); border-radius: 9px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(120,110,95,.42);
  border: 3px solid transparent; background-clip: content-box;
}

/* ---------- 1. 테마 변수 (t1 기본 / t2 / t3) ---------- */
:root,
[data-tf-theme="t1"] {
  --c-bg:#f3efe7; --c-surface:#ffffff; --c-surface2:#faf7f1;
  --c-sidebar:#26231f; --c-sb-text:rgba(245,238,225,.62);
  --c-sb-active-bg:rgba(245,238,225,.10); --c-sb-active-text:#f7f1e6;
  --c-ink:#26231f; --c-muted:#7c7468; --c-faint:#a8a094;
  --c-border:#e8e1d5; --c-border-strong:#dad2c4;
  --c-accent:#5f6b4d; --c-accent-soft:#edefe6;
  --row-py:13px;
}
[data-tf-theme="t2"] {
  --c-bg:#f4ede2; --c-surface:#fffdf9; --c-surface2:#f7efe3;
  --c-sidebar:#2a201a; --c-sb-text:rgba(244,231,216,.60);
  --c-sb-active-bg:rgba(244,231,216,.10); --c-sb-active-text:#f8efe2;
  --c-ink:#2c2118; --c-muted:#8a7a6a; --c-faint:#b6a691;
  --c-border:#e9ddcb; --c-border-strong:#dcceb8;
  --c-accent:#a5613f; --c-accent-soft:#f3e7dd;
}
[data-tf-theme="t3"] {
  --c-bg:#f0f0ec; --c-surface:#ffffff; --c-surface2:#f6f6f2;
  --c-sidebar:#23262a; --c-sb-text:rgba(233,235,238,.58);
  --c-sb-active-bg:rgba(233,235,238,.10); --c-sb-active-text:#f3f4f6;
  --c-ink:#24262a; --c-muted:#71757b; --c-faint:#a3a7ad;
  --c-border:#e3e4e1; --c-border-strong:#d3d5d1;
  --c-accent:#4f6271; --c-accent-soft:#e9edf0;
}

/* ---------- 2. 애니메이션 ---------- */
@keyframes tf-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes tf-slide { from { transform: translateX(34px); } to { transform: translateX(0); } }
@keyframes tf-pop   { from { transform: translateY(12px) scale(.985); } to { transform: translateY(0) scale(1); } }
@keyframes tf-toast { from { transform: translateY(18px); } to { transform: translateY(0); } }

/* ---------- 3. 셸: 루트 / 사이드바 / 헤더 / 메인 ---------- */
.tf-root {
  display: flex; height: 100vh; overflow: hidden;
  background: var(--c-bg); color: var(--c-ink);
}

.tf-sidebar {
  width: 248px; flex: none; height: 100vh;
  background: var(--c-sidebar);
  display: flex; flex-direction: column; overflow: hidden;
}
.tf-brand { padding: 22px 20px 16px 22px; display: flex; flex-direction: column; gap: 2px; }
.tf-brand-row { display: flex; align-items: center; gap: 9px; }
.tf-brand-logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: -.04em;
}
.tf-brand-name { color: #f5efe2; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.tf-brand-sub { color: var(--c-sb-text); font-size: 11.5px; padding-left: 35px; margin-top: -2px; }

.tf-nav { flex: 1; overflow-y: auto; padding: 6px 14px 14px 14px; }
.tf-nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 11px 10px 13px; margin: 1px 0;
  border: none; border-radius: 9px; background: transparent;
  color: var(--c-sb-text); font-weight: 500; font-size: 14px;
  cursor: pointer; text-align: left; letter-spacing: -.01em;
}
.tf-nav-item:hover { background: var(--c-sb-active-bg); }
.tf-nav-item.is-active { background: var(--c-sb-active-bg); color: var(--c-sb-active-text); font-weight: 600; }
.tf-nav-item .tf-nav-bar {
  position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 17px; border-radius: 0 2px 2px 0;
  background: var(--c-accent); opacity: 0;
}
.tf-nav-item.is-active .tf-nav-bar { opacity: 1; }
.tf-nav-item i { width: 18px; height: 18px; flex: none; opacity: .9; }
.tf-nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-nav-badge {
  flex: none; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px;
  background: #8a8276; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tf-nav-badge--warn   { background: #bf7d34; }
.tf-nav-badge--danger { background: #b4452f; }

.tf-user-card-wrap { padding: 14px; border-top: 1px solid rgba(245,238,225,.10); }
.tf-user-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; background: rgba(245,238,225,.05);
}
.tf-user-avatar {
  width: 32px; height: 32px; border-radius: 9px; background: var(--c-accent);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.tf-user-meta { flex: 1; min-width: 0; line-height: 1.25; }
.tf-user-name { color: #f3ecdf; font-size: 13px; font-weight: 600; }
.tf-user-sub { color: var(--c-sb-text); font-size: 11px; }
.tf-user-card i { width: 16px; height: 16px; color: var(--c-sb-text); }

.tf-main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.tf-header {
  flex: none; height: 60px; display: flex; align-items: center; gap: 14px;
  padding: 0 22px; background: var(--c-surface); border-bottom: 1px solid var(--c-border);
}
.tf-search { position: relative; width: 330px; max-width: 38vw; }
.tf-search i {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--c-faint);
}
.tf-search input {
  width: 100%; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--c-border); border-radius: 10px;
  background: var(--c-surface2); color: var(--c-ink); font-size: 13.5px; outline: none;
}
.tf-header-spacer { flex: 1; }

.tf-theme-switcher {
  display: flex; align-items: center; gap: 5px; padding: 4px;
  background: var(--c-surface2); border: 1px solid var(--c-border); border-radius: 11px;
}
.tf-theme-btn {
  width: 27px; height: 27px; border-radius: 7px; border: 2px solid transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0;
}
.tf-theme-btn[data-theme="t1"] { background: #f3efe7; }
.tf-theme-btn[data-theme="t2"] { background: #f4ede2; }
.tf-theme-btn[data-theme="t3"] { background: #f0f0ec; }
.tf-theme-btn.is-active { border-color: var(--c-accent); }
.tf-theme-dot { width: 9px; height: 9px; border-radius: 50%; }
.tf-theme-btn[data-theme="t1"] .tf-theme-dot { background: #5f6b4d; }
.tf-theme-btn[data-theme="t2"] .tf-theme-dot { background: #a5613f; }
.tf-theme-btn[data-theme="t3"] .tf-theme-dot { background: #4f6271; }

.tf-icon-btn {
  width: 38px; height: 38px; border: 1px solid var(--c-border); border-radius: 10px;
  background: var(--c-surface); color: var(--c-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tf-icon-btn:hover { background: var(--c-surface2); }
.tf-icon-btn i { width: 18px; height: 18px; }

.tf-user-pill {
  display: flex; align-items: center; gap: 9px; padding: 5px 12px 5px 6px;
  border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-surface); cursor: pointer;
}
.tf-user-pill:hover { background: var(--c-surface2); }
.tf-user-pill-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--c-accent-soft);
  color: var(--c-accent); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.tf-user-pill-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.18; }
.tf-user-pill-name { font-size: 12.5px; font-weight: 600; color: var(--c-ink); }
.tf-user-pill-role { font-size: 10.5px; font-weight: 600; color: var(--c-accent); }

.tf-main { flex: 1; overflow-y: auto; overflow-x: hidden; }
.tf-page { max-width: 1180px; margin: 0 auto; padding: 30px 34px 60px 34px; }
.tf-page--md { max-width: 900px; }
.tf-page--sm { max-width: 820px; }
.tf-page--xs { max-width: 760px; }

.tf-page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.tf-title { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.tf-subtitle { margin: 6px 0 0 0; font-size: 14px; color: var(--c-muted); }
.tf-h2 { margin: 0; font-size: 15px; font-weight: 700; }

/* ---------- 4. 버튼 ---------- */
.tf-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px;
  border: 1px solid var(--c-border-strong); border-radius: 10px;
  background: var(--c-surface); color: var(--c-ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.tf-btn i { width: 16px; height: 16px; }
.tf-btn:hover { background: var(--c-surface2); }
.tf-btn--primary {
  border: none; background: var(--c-accent); color: #fff;
  box-shadow: 0 1px 2px rgba(38,35,31,.12);
}
.tf-btn--primary:hover { filter: brightness(.94); background: var(--c-accent); }
.tf-btn--publish { border: none; background: #2f6f4e; color: #fff; box-shadow: 0 1px 2px rgba(38,35,31,.14); }
.tf-btn--publish:hover { filter: brightness(.95); background: #2f6f4e; }
.tf-btn--ghost { color: var(--c-muted); }
.tf-btn--ghost:hover { color: var(--c-ink); background: var(--c-surface2); }
.tf-btn--danger { border-color: #e3b9ad; color: #b4452f; background: var(--c-surface); }
.tf-btn--danger:hover { background: #fbeee9; }
.tf-btn--sm { padding: 6px 11px; border-radius: 8px; font-size: 12.5px; }
.tf-btn--sm i { width: 15px; height: 15px; }
.tf-btn--block { width: 100%; justify-content: center; }
.tf-btn:disabled, .tf-btn.is-disabled {
  background: var(--c-surface2); color: var(--c-faint);
  border-color: var(--c-border); cursor: not-allowed; box-shadow: none; opacity: .85;
}
.tf-btn-icon {
  width: 34px; height: 34px; border: 1px solid var(--c-border); border-radius: 9px;
  background: var(--c-surface); color: var(--c-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.tf-btn-icon:hover { background: var(--c-surface2); }
.tf-btn-icon i { width: 18px; height: 18px; }
.tf-link-btn {
  padding: 0; border: none; background: none; color: var(--c-accent);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}

/* ---------- 5. 카드 / KPI / 대시보드 ---------- */
.tf-card {
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px;
  box-shadow: 0 1px 2px rgba(38,35,31,.04);
}
.tf-card--pad { padding: 17px 18px; }

.tf-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.tf-kpi { padding: 17px 18px; display: flex; flex-direction: column; gap: 9px; }
.tf-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.tf-kpi-label { font-size: 13px; color: var(--c-muted); font-weight: 500; }
.tf-kpi-icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.tf-kpi-icon i { width: 16px; height: 16px; }
.tf-kpi-value-row { display: flex; align-items: baseline; gap: 7px; }
.tf-kpi-value { font-size: 29px; font-weight: 700; letter-spacing: -.025em; color: var(--c-ink); }
.tf-kpi-trend { font-size: 12.5px; font-weight: 600; }
.tf-kpi-sub { font-size: 12px; color: var(--c-faint); }

.tf-dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.tf-activity { padding: 6px 22px 16px 22px; }
.tf-activity-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 4px 0; }
.tf-activity-row { display: flex; gap: 13px; padding: 13px 0; border-top: 1px solid var(--c-border); }
.tf-activity-dot { margin-top: 5px; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tf-activity-text { font-size: 13.5px; color: var(--c-ink); line-height: 1.5; }
.tf-activity-meta { font-size: 12px; color: var(--c-faint); margin-top: 3px; }

.tf-todo-card { padding: 18px 20px; height: max-content; }
.tf-todo-list { display: flex; flex-direction: column; gap: 10px; }
.tf-todo {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px;
  border: 1px solid var(--c-border); border-radius: 11px; background: var(--c-surface2);
  cursor: pointer; text-align: left;
}
.tf-todo:hover { border-color: var(--c-accent); }
.tf-todo-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.tf-todo-icon i { width: 18px; height: 18px; }
.tf-todo-body { flex: 1; min-width: 0; }
.tf-todo-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--c-ink); }
.tf-todo-sub { display: block; font-size: 12px; color: var(--c-muted); margin-top: 1px; }

/* ---------- 6. 필터 칩 / 셀렉트 ---------- */
.tf-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tf-toolbar-spacer { flex: 1; }
.tf-chips { display: flex; align-items: center; gap: 3px; padding: 4px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; }
.tf-chip {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: none; border-radius: 7px;
  background: transparent; color: var(--c-muted); font-size: 13px; font-weight: 500; cursor: pointer;
}
.tf-chip.is-active { background: var(--c-ink); color: #fff; font-weight: 600; }
.tf-chip-count { font-size: 11.5px; opacity: .7; }

.tf-select-wrap { position: relative; }
.tf-select-wrap > i { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--c-faint); pointer-events: none; }
.tf-select {
  appearance: none; height: 38px; padding: 0 32px 0 13px;
  border: 1px solid var(--c-border); border-radius: 10px;
  background: var(--c-surface); color: var(--c-ink); font-size: 13px; cursor: pointer; outline: none;
}

/* ---------- 7. 표 (목록) ---------- */
.tf-table { overflow-x: auto; overflow-y: hidden; }
.tf-table-head, .tf-table-row {
  display: grid; align-items: center; gap: 12px; min-width: 680px; padding: 12px 18px;
}
.tf-table-head {
  background: var(--c-surface2); border-bottom: 1px solid var(--c-border);
  font-size: 12px; font-weight: 600; color: var(--c-muted);
}
.tf-table-row { padding: var(--row-py) 18px; border-top: 1px solid var(--c-border); }
.tf-table-row:hover { background: var(--c-surface2); }
.tf-col-right { text-align: right; }
.tf-table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tf-thumb {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; border: 1px solid rgba(0,0,0,.04);
  background: var(--c-accent-soft); color: var(--c-accent);
}
.tf-thumb--sm { width: 30px; height: 30px; border-radius: 7px; font-size: 12px; }
.tf-cell-main { min-width: 0; }
.tf-cell-name {
  display: block; max-width: 100%; padding: 0; border: none; background: none;
  font-size: 14px; font-weight: 600; color: var(--c-ink); cursor: pointer; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tf-cell-name:hover { color: var(--c-accent); }
.tf-cell-sub { font-size: 11.5px; color: var(--c-faint); letter-spacing: .02em; }
.tf-cell-muted { font-size: 13px; color: var(--c-muted); }
.tf-cell-date { font-size: 12.5px; color: var(--c-muted); }
.tf-table-hint { margin: 13px 2px 0 2px; font-size: 12px; color: var(--c-faint); }

.tf-empty { padding: 60px 24px; text-align: center; }
.tf-empty-icon {
  width: 54px; height: 54px; border-radius: 14px; margin: 0 auto 14px auto;
  background: var(--c-surface2); display: flex; align-items: center; justify-content: center; color: var(--c-faint);
}
.tf-empty-icon i { width: 26px; height: 26px; }
.tf-empty-title { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.tf-empty-sub { font-size: 13px; color: var(--c-muted); margin-bottom: 16px; }

/* ---------- 8. 뱃지 (상태/유형) ---------- */
.tf-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.tf-badge-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.tf-badge--sm { padding: 2px 8px 2px 7px; font-size: 11px; }
.tf-badge--sm .tf-badge-dot { width: 5px; height: 5px; }

/* KB 발행 상태: 발행됨 / 임시저장(초안) / 보관 */
.tf-badge--published { background: #e7f1ea; color: #2f6f4e; }
.tf-badge--published .tf-badge-dot { background: #3f8a63; }
.tf-badge--draft     { background: #efece7; color: #6f6a60; }
.tf-badge--draft .tf-badge-dot { background: #a39e93; }
.tf-badge--archived  { background: #f6ead9; color: #a4632b; }
.tf-badge--archived .tf-badge-dot { background: #c98a4e; }

/* 판매 상태: 판매중 / 품절 / 판매중지 */
.tf-badge--onsale  { background: #e7f1ea; color: #2f6f4e; }
.tf-badge--onsale .tf-badge-dot { background: #3f8a63; }
.tf-badge--soldout { background: #f7e7e1; color: #b4452f; }
.tf-badge--soldout .tf-badge-dot { background: #c45a42; }
.tf-badge--stopped { background: #efece7; color: #6f6a60; }
.tf-badge--stopped .tf-badge-dot { background: #a39e93; }

/* 학습함 상태: 대기 / 답변 작성중 / 초안 / 발행됨 */
.tf-badge--pending   { background: #efece7; color: #6f6a60; }
.tf-badge--pending .tf-badge-dot { background: #a39e93; }
.tf-badge--answering { background: #fbf1df; color: #bf7d34; }
.tf-badge--answering .tf-badge-dot { background: #d49a45; }
.tf-badge--drafted   { background: #e9edf0; color: #4f6271; }
.tf-badge--drafted .tf-badge-dot { background: #6f8499; }

/* 핸드오프 처리 상태: 대기 / 확인됨 / 완료 */
.tf-badge--ht-wait { background: #f7e7e1; color: #b4452f; }
.tf-badge--ht-wait .tf-badge-dot { background: #c45a42; }
.tf-badge--ht-ack  { background: #e9edf0; color: #4f6271; }
.tf-badge--ht-ack .tf-badge-dot { background: #6f8499; }
.tf-badge--ht-done { background: #e7f1ea; color: #2f6f4e; }
.tf-badge--ht-done .tf-badge-dot { background: #3f8a63; }

/* 핸드오프 유형 (점 없는 칩): 금전 / 결함 / 주문 / 안전 */
.tf-badge--type { padding: 2px 8px; }
.tf-badge--type-money  { background: #f6ead9; color: #a4632b; }
.tf-badge--type-defect { background: #f7e1db; color: #b4452f; }
.tf-badge--type-order  { background: #e8ebf1; color: #51607a; }
.tf-badge--type-safety { background: #efe7d2; color: #6f5a2e; }

/* 민감(항상 사람 처리) 표식 */
.tf-badge--sensitive { background: #f7e7e1; color: #b4452f; padding: 1px 7px; }

/* ---------- 9. 폼 / 입력 ---------- */
.tf-field { display: flex; flex-direction: column; gap: 6px; }
.tf-field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tf-field-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.tf-label { font-size: 12.5px; font-weight: 600; color: var(--c-ink); }
.tf-label-req { color: #b4452f; }
.tf-section-label { font-size: 12.5px; font-weight: 700; color: var(--c-muted); letter-spacing: .02em; }
.tf-help { font-size: 11.5px; color: var(--c-faint); }

.tf-input, .tf-textarea {
  width: 100%; border: 1px solid var(--c-border-strong); border-radius: 10px;
  background: var(--c-surface); color: var(--c-ink); font-size: 14px; outline: none;
}
.tf-input { height: 40px; padding: 0 12px; }
.tf-input--sm { height: 36px; border-radius: 8px; border-color: var(--c-border); font-size: 13px; padding: 0 10px; }
.tf-textarea { padding: 11px 12px; line-height: 1.6; }
.tf-input:focus, .tf-textarea:focus, .tf-select:focus { border-color: var(--c-accent); }
.tf-form-select {
  appearance: none; width: 100%; height: 40px; padding: 0 32px 0 12px;
  border: 1px solid var(--c-border-strong); border-radius: 10px;
  background: var(--c-surface); color: var(--c-ink); font-size: 14px; cursor: pointer; outline: none;
}

/* 옵션 표 (상품 폼) */
.tf-opt-table { border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; }
.tf-opt-head, .tf-opt-row {
  display: grid; grid-template-columns: 108px minmax(0,1fr) 110px 86px 38px; gap: 10px; align-items: center; padding: 9px 12px;
}
.tf-opt-head { background: var(--c-surface2); font-size: 11.5px; font-weight: 600; color: var(--c-muted); }
.tf-opt-row { padding: 8px 12px; border-top: 1px solid var(--c-border); background: var(--c-surface); }
.tf-opt-del {
  width: 30px; height: 30px; border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-surface); color: var(--c-faint); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tf-opt-del:hover { color: #b4452f; border-color: #e3b9ad; }
.tf-add-row {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px;
  border: 1px dashed var(--c-border-strong); border-radius: 9px; background: none;
  color: var(--c-muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.tf-add-row:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* 분리형 상태 선택 (임시저장/발행/보관) */
.tf-seg { display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--c-surface2); border: 1px solid var(--c-border); border-radius: 9px; }
.tf-seg-btn { padding: 6px 11px; border: none; border-radius: 6px; background: transparent; color: var(--c-muted); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.tf-seg-btn.is-active { background: var(--c-surface); color: var(--c-ink); font-weight: 600; }

/* ---------- 10. 알림 박스 / 안내 ---------- */
.tf-alert { display: flex; gap: 11px; padding: 13px 15px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.tf-alert i { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.tf-alert--info   { border: 1px solid #cfe0d2; background: #eaf3ec; color: #2c5a40; }
.tf-alert--info i { color: #2f6f4e; }
.tf-alert--ai     { border: 1px solid #e7d4ad; background: #fbf3e0; color: #7a5a23; }
.tf-alert--ai i   { color: #b9842f; }
.tf-alert--danger { border: 1px solid #e6c9bf; background: #fbeee9; color: #8a3d2b; }
.tf-alert--danger i { color: #b4452f; }

/* ---------- 11. 토스트 ---------- */
.tf-toast-wrap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none;
}
.tf-toast {
  display: flex; align-items: center; gap: 11px; padding: 13px 17px; border-radius: 12px;
  background: #26231f; color: #f5efe2; box-shadow: 0 16px 40px -16px rgba(33,28,22,.6);
  animation: tf-toast .26s cubic-bezier(.22,1,.36,1); pointer-events: auto; max-width: 520px;
}
.tf-toast-icon { width: 22px; height: 22px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; flex: none; background: #8a8276; }
.tf-toast-icon i { width: 13px; height: 13px; }
.tf-toast-icon--success { background: #3f8a63; }
.tf-toast-icon--archive { background: #c4824a; }
.tf-toast-icon--danger  { background: #b4452f; }
.tf-toast-msg { font-size: 13.5px; line-height: 1.45; }

/* ---------- 12. 오버레이 / 드로어 / 모달 ---------- */
.tf-overlay { position: fixed; inset: 0; background: rgba(33,28,22,.42); z-index: 40; }
.tf-overlay--modal {
  background: rgba(33,28,22,.5); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}

.tf-drawer {
  position: fixed; top: 0; right: 0; width: 760px; max-width: 95vw; height: 100vh; z-index: 41;
  background: var(--c-bg); display: flex; flex-direction: column;
  box-shadow: -18px 0 50px -28px rgba(33,28,22,.5);
  animation: tf-slide .26s cubic-bezier(.22,1,.36,1);
}
.tf-drawer--narrow { width: 560px; }
.tf-drawer-head {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 18px 24px;
  background: var(--c-surface); border-bottom: 1px solid var(--c-border);
}
.tf-drawer-head-main { flex: 1; min-width: 0; }
.tf-drawer-eyebrow { font-size: 11.5px; font-weight: 600; color: var(--c-accent); letter-spacing: .02em; }
.tf-drawer-title { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-drawer-body { flex: 1; overflow-y: auto; padding: 22px 24px 24px 24px; }
.tf-drawer-foot {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 24px;
  background: var(--c-surface); border-top: 1px solid var(--c-border);
}
.tf-foot-spacer { flex: 1; }

.tf-modal {
  width: 560px; max-width: 100%; background: var(--c-surface); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(33,28,22,.6); animation: tf-pop .24s cubic-bezier(.22,1,.36,1);
}
.tf-modal--sm { width: 440px; padding: 24px; }
.tf-modal-head { display: flex; align-items: flex-start; gap: 13px; padding: 22px 24px 16px 24px; }
.tf-modal-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--c-accent-soft); color: var(--c-accent); display: flex; align-items: center; justify-content: center; flex: none; }
.tf-modal-icon i { width: 20px; height: 20px; }
.tf-modal-title { font-size: 16px; font-weight: 700; }
.tf-modal-desc { font-size: 13px; color: var(--c-muted); margin-top: 3px; line-height: 1.5; }
.tf-modal-foot { display: flex; align-items: center; gap: 10px; }

/* AI 정리로 빠르게 채우기 버튼 */
.tf-ai-cta {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 14px 16px;
  border: 1px solid var(--c-accent); border-radius: 12px; background: var(--c-accent-soft);
  cursor: pointer; text-align: left;
}
.tf-ai-cta:hover { filter: brightness(.98); }
.tf-ai-cta-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--c-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.tf-ai-cta-title { display: block; font-size: 13.5px; font-weight: 700; color: var(--c-ink); }
.tf-ai-cta-sub { display: block; font-size: 12px; color: var(--c-muted); margin-top: 1px; }

/* ---------- 13. 핸드오프 상세 ---------- */
.tf-handoff-grid { display: grid; grid-template-columns: 344px minmax(0,1fr); gap: 16px; margin-top: 18px; align-items: start; }
.tf-ticket-list { display: flex; flex-direction: column; gap: 9px; }
.tf-ticket {
  display: block; width: 100%; padding: 14px 15px; border: 1px solid var(--c-border); border-radius: 12px;
  background: var(--c-surface); cursor: pointer; text-align: left;
}
.tf-ticket.is-active { border-color: var(--c-accent); background: var(--c-accent-soft); }
.tf-ticket-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.tf-ticket-id { font-size: 13px; font-weight: 700; color: var(--c-ink); }
.tf-ticket-summary { display: block; font-size: 13px; color: var(--c-muted); line-height: 1.45; max-height: 38px; overflow: hidden; }
.tf-ticket-meta { display: block; font-size: 11.5px; color: var(--c-faint); margin-top: 7px; }
.tf-pii-box { border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; }
.tf-pii-head { display: flex; align-items: center; gap: 8px; padding: 12px 15px; background: var(--c-surface2); }
.tf-pii-row { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--c-border); }
.tf-pii-key { font-size: 13px; color: var(--c-muted); }
.tf-pii-val { font-size: 13.5px; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.tf-photo-thumb {
  width: 94px; height: 94px; border-radius: 11px;
  background: repeating-linear-gradient(135deg,#efe9df 0 7px,#e7e0d3 7px 14px);
  border: 1px solid var(--c-border); display: flex; align-items: center; justify-content: center; color: var(--c-faint);
}

/* ---------- 14. 로그인 ---------- */
.tf-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--c-bg); padding: 24px; }
.tf-login-card { width: 380px; max-width: 100%; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px; padding: 30px 28px; box-shadow: 0 20px 60px -30px rgba(33,28,22,.5); }
.tf-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tf-login-title { font-size: 18px; font-weight: 700; margin: 14px 0 4px 0; }
.tf-login-sub { font-size: 13px; color: var(--c-muted); margin: 0 0 20px 0; }
.tf-login-card .tf-input { margin-bottom: 14px; }
.tf-login-error { font-size: 13px; color: #b4452f; margin: 0 0 14px 0; }

/* ---------- 15. 유틸 ---------- */
.tf-stack { display: flex; flex-direction: column; }
.tf-stack-9 { display: flex; flex-direction: column; gap: 9px; }
.tf-stack-11 { display: flex; flex-direction: column; gap: 11px; }
.tf-row { display: flex; align-items: center; gap: 10px; }
.tf-spacer { flex: 1; }
.tf-mt-14 { margin-top: 14px; }
.tf-mt-18 { margin-top: 18px; }
.tf-mt-20 { margin-top: 20px; }
.tf-mb-14 { margin-bottom: 14px; }
.tf-hidden { display: none !important; }

/* 카테고리 관리 핀 (categories.html) */
.tf-cat-pill { display: inline-flex; align-items: center; gap: 5px; padding: 6px 6px 6px 13px; border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-surface2); font-size: 13.5px; font-weight: 500; color: var(--c-ink); }
.tf-cat-pill-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%; background: transparent; color: var(--c-faint); cursor: pointer; }
.tf-cat-pill-x:hover { background: var(--c-border-strong); color: var(--c-ink); }
.tf-cat-pill-x i { width: 13px; height: 13px; }
