/* KoDATA 기술기업개요표 — 차분한 비즈니스 문서 톤 (진청 베이스)
   원칙
   · 색은 한 가지 중심색(진청) + 회색 계조. 그라디언트 금지
   · 그림자 거의 없음. 1px 보더와 충분한 여백으로 격(格) 만들기
   · Pretendard 200/400/600/700 무게 대비로 위계
   · 도움말은 항상 보임 (라벨 아래 작은 회색 글씨), 포커스 시 강조
*/

:root {
  --bg:           #f4f6fa;
  --bg-soft:      #eef1f6;
  --paper:        #ffffff;

  --ink:          #0f172a;        /* 거의 검정 (slate-900) */
  --ink-1:        #1e293b;
  --ink-2:        #334155;
  --ink-3:        #64748b;        /* 보조 텍스트 */
  --ink-4:        #94a3b8;        /* 옅은 텍스트 */

  --line:         #d8dde6;
  --line-soft:    #e5e8ee;
  --line-faint:   #eef0f4;

  --primary:      #1d3a8a;        /* 진청 */
  --primary-2:    #2547ad;
  --primary-3:    #3b5fc8;
  --primary-soft: #e8edf9;
  --primary-line: #c4cfe8;

  --ok:           #15803d;
  --warn:         #b45309;
  --danger:       #b91c1c;

  --shadow-1: 0 1px 0 rgba(15, 23, 42, .04);
  --shadow-2: 0 1px 2px rgba(15, 23, 42, .04), 0 0 0 1px rgba(15, 23, 42, .02);

  --font-kr: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
             system-ui, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-mono: "Pretendard Variable", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-kr);
  font-size: 15.5px;
  line-height: 1.6;
  letter-spacing: -.012em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 1, "ss03" 1;
}
body.form-body { padding-bottom: 130px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ============== 헤더 ============== */
.form-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(244, 246, 250, .9);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 18px 32px 12px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
}
.header-title { min-width: 0; flex: 1; }
.kicker {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .14em;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.header-title h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.025em;
  margin: 0;
  line-height: 1.2;
  color: var(--ink);
}

.save-status {
  font-size: .76rem;
  color: var(--ink-3);
  white-space: nowrap;
  letter-spacing: -.005em;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 0;
  font-variant-numeric: tabular-nums;
}
.save-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
}
.save-status.saving::before { background: var(--primary); animation: pulse 1.1s infinite; }
.save-status.saved::before  { background: var(--ok); }
.save-status.error::before  { background: var(--danger); }
.save-status.saving { color: var(--primary); }
.save-status.saved  { color: var(--ok); }
.save-status.error  { color: var(--danger); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* 단계 진행 — 헤더 하단에 살짝 두꺼운 진행바 */
.step-rail {
  max-width: 1100px; margin: 0 auto;
  padding: 0 32px;
  display: flex; gap: 3px;
  height: 3px;
  margin-top: -1px;
}
.step-rail .seg {
  flex: 1; height: 100%;
  background: var(--line);
  border-radius: 2px;
  transition: background .25s ease;
}
.step-rail .seg.done    { background: var(--primary); }
.step-rail .seg.current { background: var(--primary); opacity: .55; }

/* ============== 본문 ============== */
.form-shell {
  max-width: 1100px; margin: 0 auto;
}
.form-root { padding: 28px 32px 32px; }

/* 우측 도움말 패널은 데스크탑에서만 */
.help-panel { display: none; }
.help-panel-inner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
}
.help-title {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--ink-3);
  letter-spacing: .14em;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.help-body {
  font-size: .9rem;
  color: var(--ink-2);
  line-height: 1.7;
  min-height: 110px;
}
.help-body.active { color: var(--ink-1); }

@media (min-width: 1024px) {
  .form-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
    padding: 0 32px;
  }
  .form-root { padding: 32px 0; }
  .help-panel {
    display: block;
    position: sticky;
    top: 92px;
    align-self: start;
    margin-top: 32px;
    transition: top .32s cubic-bezier(.4, 0, .2, 1);
  }
}

/* 단계 인디케이터 */
.step-progress {
  margin-bottom: 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.step-progress .step-num {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-3);
  letter-spacing: .04em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.step-progress .step-num strong {
  color: var(--primary);
  font-weight: 700;
}
.step-progress .step-name {
  font-size: .82rem;
  color: var(--ink-4);
  letter-spacing: -.005em;
}

/* 섹션 카드 */
.section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 30px 8px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.section > h2 {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -.025em;
  margin: 0 0 4px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-faint);
  margin-bottom: 4px;
}
.section > h2 .sec-num {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .08em;
  background: var(--primary-soft);
  padding: 3px 8px;
  border-radius: 3px;
}
.section-desc {
  margin: 14px 0 18px;
  color: var(--ink-3);
  font-size: .88rem;
  line-height: 1.65;
}

/* ============== 필드 ============== */
.field { margin: 18px 0; }
.field .lab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--ink-2);
  margin-bottom: 7px;
  font-weight: 600;
  letter-spacing: -.005em;
}
.help-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: .65rem;
  cursor: help;
  user-select: none;
  font-weight: 700;
  background: var(--paper);
  transition: all .12s ease;
}
.help-tag:hover, .help-tag:focus {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

/* 입력칸 — 깔끔한 박스 입력. 한국 폼지의 정자(正字) 느낌 */
.field input[type="text"], .field input[type="tel"], .field input[type="email"],
.field input[type="number"], .field input[type="date"], .field input[type="url"],
.field input[type="password"], .field input[type="search"],
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: .98rem;
  transition: border-color .12s ease, box-shadow .12s ease;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder, .field textarea::placeholder {
  color: var(--ink-4);
  font-weight: 400;
}
.field textarea {
  min-height: 96px; resize: vertical; line-height: 1.65;
}
.field input:hover, .field textarea:hover { border-color: var(--ink-4); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.field input[type="number"] { font-variant-numeric: tabular-nums; }

/* 옵션 (라디오/체크) — 칩 형태, 선택은 진청으로 채움 */
.opts {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 2px 0;
}
.opts label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font-size: .9rem;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all .1s ease;
}
.opts label:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.opts label.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.opts input { display: none; }

/* 반복 행 */
.repeat-row {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px 4px;
  margin-bottom: 10px;
  position: relative;
}
.repeat-row .row-num {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--ink-3);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.repeat-row .row-del {
  position: absolute; top: 10px; right: 10px;
  background: transparent; border: 1px solid transparent;
  color: var(--ink-3);
  font-size: .78rem; cursor: pointer;
  padding: 4px 10px; border-radius: 3px;
  font-family: inherit;
}
.repeat-row .row-del:hover { color: var(--danger); border-color: var(--line); }

.add-row {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--primary);
  padding: 11px;
  width: 100%;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 4px;
  transition: all .12s ease;
  margin-bottom: 12px;
}
.add-row:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ============== 업로드 슬롯 ============== */
.upload-slot {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 10px;
  background: var(--paper);
  transition: border-color .12s ease;
}
.upload-slot:hover { border-color: var(--ink-4); }
.upload-title {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: .94rem;
  color: var(--ink);
  letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.upload-title::before {
  content: ""; width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d3a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3C/svg%3E") center/contain no-repeat;
  flex: 0 0 14px;
}
.file-list { list-style: none; padding: 0; margin: 0 0 10px; }
.file-list li {
  padding: 8px 0;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line-faint);
  font-size: .9rem;
}
.file-list li:last-of-type { border-bottom: none; }
.file-list li.muted {
  color: var(--ink-4);
  font-size: .84rem;
  padding: 2px 0 6px;
  border-bottom: none;
}
.file-list a { color: var(--primary); word-break: break-all; flex: 1; font-weight: 500; }
.muted { color: var(--ink-4); font-size: .82rem; }
.file-del {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: .78rem; cursor: pointer; font-family: inherit;
}
.file-del:hover { color: var(--danger); border-color: var(--danger); }
.upload-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--primary);
  padding: 11px;
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .12s ease;
}
.upload-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.upload-btn:disabled { opacity: .55; cursor: wait; }

/* ============== 제출 완료 배너 ============== */
.submitted-banner {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3px solid var(--ok);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: .88rem;
  color: var(--ink-1);
  line-height: 1.6;
}
.submitted-banner strong { color: var(--ok); font-weight: 700; }
.submitted-banner .muted { display: block; margin-top: 4px; font-size: .82rem; color: var(--ink-3); }

/* ============== 도움말 — 항상 인라인 표시 (작은 회색) ============== */
.field-help-inline {
  margin-top: 7px;
  font-size: .8rem;
  color: var(--ink-3);
  line-height: 1.6;
  padding: 0 0 0 1px;
  letter-spacing: -.005em;
  transition: color .12s ease;
}
.field.has-help:focus-within .field-help-inline,
.field.has-help:hover .field-help-inline,
.field.has-help.show-help .field-help-inline {
  color: var(--primary);
}

/* ============== 푸터 ============== */
.form-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 11px 32px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
@media (min-width: 1024px) {
  /* 데스크탑에선 푸터도 폼 본문 폭에 맞춰 정렬 (도움말 폭 빼고) */
  .footer-inner {
    max-width: calc(1100px - 32px);
    padding-right: calc(32px + 300px + 40px);
  }
}
.nav-row { display: flex; gap: 8px; }
.nav-row button {
  flex: 1; min-width: 0;
  padding: 12px 10px;
  border-radius: 4px;
  font: inherit;
  font-size: .94rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
  letter-spacing: -.005em;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
}
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #dc2626;
  padding: 7px 14px;
  font-size: .88rem;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  font-weight: 500;
  transition: background .12s;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-soft {
  background: var(--paper);
  border: 1px solid var(--primary-line);
  color: var(--primary);
}
.btn-soft:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn-ghost {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-soft); border-color: var(--ink-4); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.note {
  margin: 4px 0 0;
  font-size: .74rem;
  color: var(--ink-4);
  text-align: center;
  letter-spacing: -.005em;
}

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 100px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 4px;
  font-size: .88rem; font-weight: 500;
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 100; max-width: 90vw; text-align: center;
  letter-spacing: -.005em;
  box-shadow: 0 6px 24px rgba(15, 23, 42, .18);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============== 관리자 ============== */
.admin {
  padding: 32px 24px 80px;
  max-width: 960px; margin: 0 auto;
}
.admin h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 0 0 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.card h2 {
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 16px;
}
.card label {
  display: block; margin-bottom: 14px;
  font-size: .82rem; color: var(--ink-2);
  font-weight: 600;
}
.card input[type="text"] {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 4px;
  margin-top: 6px; font: inherit; font-size: .98rem;
  background: var(--paper);
}
.card input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.card button {
  background: var(--primary); color: #fff; border: 1px solid var(--primary);
  padding: 10px 20px; border-radius: 4px;
  cursor: pointer; font: inherit; font-weight: 600;
  letter-spacing: -.005em; font-size: .94rem;
}
.card button:hover { background: var(--primary-2); }
.card .ok {
  color: var(--ok); margin-top: 14px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid #bbf7d0;
  border-left: 3px solid var(--ok);
  border-radius: 3px;
  word-break: break-all; font-size: .88rem;
}
.card .ok a { color: var(--primary); font-weight: 600; }
.card .ok button {
  background: var(--paper); color: var(--primary);
  border: 1px solid var(--primary-line);
  padding: 4px 10px; font-size: .8rem; margin-left: 8px;
}

table {
  width: 100%; border-collapse: collapse; margin-top: 14px;
  font-size: .88rem;
}
table th, table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-faint);
  text-align: left;
}
table th {
  color: var(--ink-3); font-weight: 700;
  font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
table td a { color: var(--primary); font-weight: 500; }

/* ============== 로그인 / 회원가입 ============== */
.auth-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.auth-shell { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-1);
}
.auth-header { margin-bottom: 22px; }
.auth-header .kicker { margin-bottom: 8px; }
.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.025em;
  margin: 0;
  color: var(--ink);
}
.auth-form .field { margin-bottom: 16px; }
.auth-error {
  min-height: 22px;
  margin: 6px 0 12px;
  font-size: .85rem;
  color: var(--danger);
}
.auth-submit {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  margin-top: 4px;
  border-radius: 4px;
}
.auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-faint);
  font-size: .88rem;
  color: var(--ink-3);
  text-align: center;
}
.auth-foot a {
  color: var(--primary);
  font-weight: 600;
}

/* admin 상단바 */
.admin-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.admin-top h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 0;
}
.user-bar {
  display: flex; align-items: center; gap: 12px;
  font-size: .9rem;
  color: var(--ink-2);
}
.user-name { display: inline-flex; align-items: center; gap: 8px; }
.role-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 3px;
}
.role-tag.role-admin {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-line);
}
.role-tag.role-staff {
  background: #f3f4f6;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-small {
  font-size: .8rem !important;
  padding: 4px 10px !important;
}

/* ============== 작은 화면 ============== */
@media (max-width: 640px) {
  body.form-body { padding-bottom: 120px; }
  .header-inner { padding: 14px 16px 10px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .header-title h1 { font-size: 1.22rem; }
  .step-rail { padding: 0 16px; }
  .form-root { padding: 22px 16px 24px; }
  .section { padding: 22px 18px 4px; }
  .section > h2 { font-size: 1.08rem; }
  .footer-inner { padding: 10px 16px 12px; }
  .nav-row button { padding: 12px 6px; font-size: .9rem; }
}

/* ===================================================================
   ADMIN LAYOUT — 사이드바 + 헤더 + 페이지 컨테이너
   톤: 진청(#1d3a8a) + 단정한 한국 비즈니스 폼지 느낌
   =================================================================== */
body.admin-body {
  background: #f6f7f9;
  min-height: 100vh;
  display: flex;
  font-feature-settings: "ss01", "ss02";  /* Pretendard 자모 디테일 */
}

/* ─── 사이드바 ─── */
.admin-sidebar {
  width: 230px;
  background: #0f172a;
  color: #cbd5e1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid #1e293b;
}
.admin-sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 22px 20px;
  border-bottom: 1px solid #1e293b;
}
.admin-sidebar .brand-mark {
  width: 38px; height: 38px;
  background: var(--primary);
  color: #fff; font-weight: 800; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  letter-spacing: -.02em;
}
.admin-sidebar .brand-text {
  font-weight: 700; line-height: 1.2;
  letter-spacing: -.01em;
  color: #f1f5f9;
}
.admin-sidebar .brand-text span {
  font-size: .7rem; color: #64748b; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
}
.admin-nav { flex: 1; padding: 16px 10px; overflow-y: auto; }
.admin-nav .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  margin-bottom: 2px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 4px;
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: -.005em;
  position: relative;
  transition: background .14s ease, color .14s ease;
}
.admin-nav .nav-item:hover {
  background: #1e293b;
  color: #f1f5f9;
}
.admin-nav .nav-item.active {
  background: rgba(29, 58, 138, .9);
  color: #fff;
  font-weight: 600;
}
.admin-nav .nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px; top: 8px; bottom: 8px;
  width: 3px;
  background: #d4a24c;  /* 포인트 골드 */
  border-radius: 0 2px 2px 0;
}
.admin-foot {
  padding: 16px 18px 18px;
  border-top: 1px solid #1e293b;
  display: flex; flex-direction: column; gap: 12px;
}
.me-block { display: flex; align-items: center; gap: 8px; }
.me-name {
  font-weight: 600; color: #f1f5f9; flex: 1;
  font-size: .9rem; letter-spacing: -.01em;
}
.me-role {
  font-size: .64rem; font-weight: 700;
  padding: 2px 7px; border-radius: 2px;
  letter-spacing: .08em; text-transform: uppercase;
}
.me-role.role-admin { background: var(--primary); color: #fff; }
.me-role.role-staff { background: #334155; color: #cbd5e1; }
.btn-ghost {
  background: transparent;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 7px 10px;
  border-radius: 3px;
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .14s ease;
}
.btn-ghost:hover { background: #1e293b; color: #fff; border-color: #475569; }

/* ─── 메인 영역 ─── */
.admin-main {
  flex: 1;
  padding: 32px 40px 64px;
  overflow-x: auto;
  min-width: 0;
  max-width: 1600px;
}
.admin-page-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}
.admin-page-head h1 {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -.035em;
  color: #0f172a;
  margin: 0;
}
.admin-page-head .desc {
  color: #64748b;
  font-size: .9rem;
  margin-top: 6px;
  letter-spacing: -.005em;
}
.admin-page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── 어드민 내 모든 버튼 통일 (btn-primary/danger/ghost 제외) ─── */
.admin-main button:not(.btn-primary):not(.btn-danger):not(.btn-ghost):not(.tab-btn):not(.__btn):not([class*="kanban"]) {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 3px;
  font: inherit;
  font-size: .82rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all .12s ease;
  letter-spacing: -.005em;
  margin-right: 4px;
}
.admin-main button:not(.btn-primary):not(.btn-danger):not(.btn-ghost):not(.tab-btn):not(.__btn):not([class*="kanban"]):hover:not(:disabled) {
  background: #f8fafc;
  border-color: #1d3a8a;
  color: #1d3a8a;
}
.admin-main button:not(.btn-primary):not(.btn-danger):not(.btn-ghost):last-child { margin-right: 0; }

/* 표 안 버튼은 더 작게 */
.data-table td button:not(.btn-primary):not(.btn-danger) {
  padding: 4px 10px !important;
  font-size: .78rem !important;
}

/* ─── select 통일 (native OS 스타일 제거) ─── */
.admin-main select,
.admin-page-head select,
.toolbar select,
.modal select,
.field select,
.data-table select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 6px 30px 6px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font: inherit;
  font-size: .88rem;
  color: #1e293b;
  background-color: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.admin-main select:hover,
.toolbar select:hover { border-color: #94a3b8; }
.admin-main select:focus,
.toolbar select:focus,
.modal select:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 58, 138, .08);
}
.admin-main select:disabled { opacity: .5; cursor: not-allowed; }

/* 표 안 select은 더 작게 */
.data-table td select {
  padding: 4px 26px 4px 9px !important;
  font-size: .82rem !important;
}

/* ─── 표 안 액션 버튼 그룹 (열기/복사/삭제 등) ─── */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.row-actions .row-link,
.row-actions .row-btn {
  display: inline-block;
  padding: 4px 10px !important;
  font-size: .78rem !important;
  font-weight: 500;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #fff;
  color: #334155 !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
  letter-spacing: -.005em;
  line-height: 1.4;
  margin: 0 !important;
}
.row-actions .row-link:hover,
.row-actions .row-btn:hover {
  background: #f8fafc;
  border-color: var(--primary);
  color: var(--primary) !important;
  text-decoration: none !important;
}
.row-actions .row-btn-danger:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #dc2626 !important;
}

/* ─── input[type=text/number/email/tel/password] 통일 ─── */
.admin-main input[type=text],
.admin-main input[type=number],
.admin-main input[type=email],
.admin-main input[type=tel],
.admin-main input[type=password],
.admin-main input[type=search],
.admin-main textarea {
  appearance: none;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 7px 11px;
  font: inherit;
  font-size: .9rem;
  color: #1e293b;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
  letter-spacing: -.005em;
}
.admin-main input:focus,
.admin-main textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 58, 138, .08);
}
.admin-main textarea { resize: vertical; min-height: 60px; }

/* ─── checkbox 한국 비즈니스 톤 (진청 accent) ─── */
.admin-main input[type=checkbox],
.modal input[type=checkbox] {
  accent-color: var(--primary);
  width: 16px; height: 16px;
  cursor: pointer;
  vertical-align: middle;
}
.admin-main label { cursor: pointer; user-select: none; }

/* ─── KPI 카드 ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.kpi-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
}
.kpi-label {
  color: #64748b;
  font-size: .78rem;
  margin-bottom: 8px;
  letter-spacing: .02em;
  font-weight: 500;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.04em;
  font-feature-settings: "tnum";
}
.kpi-suffix { font-size: 1rem; color: #64748b; margin-left: 4px; font-weight: 500; }

/* ─── 패널 ─── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.dash-grid > .panel { padding: 22px 24px; }
.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 24px 26px;
}
.panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -.015em;
  color: #0f172a;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

/* ─── 배지 (등급 + 상태) ─── */
.grade-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: .03em;
  font-feature-settings: "tnum";
}
.grade-A { background: #fef3c7; color: #854d0e; border: 1px solid #fcd34d; }
.grade-B { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.grade-C { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.status-badge {
  display: inline-block;
  font-size: .7rem; font-weight: 600;
  padding: 2px 8px; border-radius: 2px;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.status-new      { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.status-wait     { background: #fef9c3; color: #713f12; border-color: #fde047; }
.status-active   { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.status-talk     { background: #f3e8ff; color: #581c87; border-color: #d8b4fe; }
.status-done     { background: #dcfce7; color: #14532d; border-color: #86efac; }
.status-rejected { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }

/* ─── 데이터 테이블 ─── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-feature-settings: "tnum";
}
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  font-size: .9rem;
  letter-spacing: -.005em;
}
.data-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  font-size: .76rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid #cbd5e1;
  padding: 11px 14px;
}
.data-table tr:hover td { background: #f8fafc; }
.data-table a { color: var(--primary); font-weight: 500; text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.data-table tbody td button { font-size: .8rem; }
.data-table input[type=number] { font-family: inherit; }

/* ─── 툴바 ─── */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
.toolbar input[type=text], .toolbar select {
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font: inherit;
  font-size: .9rem;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
  letter-spacing: -.005em;
}
.toolbar input[type=text]:focus, .toolbar select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 58, 138, .08);
}
.toolbar .spacer { flex: 1; }

/* ─── 페이지네이션 ─── */
.pagination {
  display: flex; gap: 4px; justify-content: center; margin-top: 22px;
}
.pagination button {
  padding: 7px 13px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  border-radius: 3px;
  font-size: .85rem;
  font-feature-settings: "tnum";
  color: #475569;
  font-weight: 500;
  transition: all .12s;
}
.pagination button:hover:not(:disabled):not(.active) {
  background: #f8fafc;
  border-color: #94a3b8;
}
.pagination button.active {
  background: var(--primary); color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ─── 모달 ─── */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff;
  border-radius: 4px;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  padding: 28px 30px 24px;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
}
.modal h2 {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -.025em;
  color: #0f172a;
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}
.modal .field { margin-bottom: 14px; }
.modal .field .lab {
  display: block; font-size: .82rem; font-weight: 600;
  color: #475569; margin-bottom: 5px;
  letter-spacing: .01em;
}
.modal input[type=text], .modal input[type=number], .modal input[type=email],
.modal input[type=tel], .modal input[type=password], .modal textarea, .modal select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font: inherit;
  font-size: .92rem;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.modal input:focus, .modal textarea:focus, .modal select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 58, 138, .08);
}

/* ─── Kanban ─── */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  overflow-x: auto;
}
.kanban-col {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 12px 10px;
  min-height: 450px;
  border: 1px solid #e2e8f0;
}
.kanban-col h4 {
  font-size: .8rem; font-weight: 700; margin: 0 0 12px;
  padding: 0 4px;
  display: flex; justify-content: space-between; align-items: center;
  color: #334155;
  letter-spacing: -.01em;
}
.kanban-col h4 .count {
  background: #fff; color: #64748b;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-feature-settings: "tnum";
}
.kanban-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 11px 13px;
  margin-bottom: 8px;
  cursor: grab;
  font-size: .85rem;
  transition: box-shadow .14s, border-color .14s;
}
.kanban-card:hover {
  box-shadow: 0 3px 10px rgba(15,23,42,.08);
  border-color: #cbd5e1;
}
.kanban-card .biz {
  color: #64748b;
  font-size: .76rem;
  margin-top: 4px;
  letter-spacing: -.005em;
  font-feature-settings: "tnum";
}

/* ─── 활동 타임라인 ─── */
.timeline {
  border-left: 2px solid #e2e8f0;
  padding-left: 18px;
  margin-left: 7px;
}
.timeline-item {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 14px;
}
.timeline-item:last-child { margin-bottom: 0; padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -25px; top: 7px;
  width: 11px; height: 11px;
  background: var(--primary);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1;
}
.timeline-meta {
  color: #64748b;
  font-size: .78rem;
  letter-spacing: -.005em;
}
.timeline-note {
  margin-top: 5px;
  color: #1e293b;
  font-size: .9rem;
  line-height: 1.5;
}
.timeline-type {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 2px;
  background: rgba(29, 58, 138, .08);
  color: var(--primary);
  margin-right: 6px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ─── 탭 버튼 (콘텐츠 페이지) ─── */
.tab-btn {
  padding: 9px 18px !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  cursor: pointer;
  border-radius: 3px !important;
  font-weight: 500;
  font-size: .9rem !important;
  color: #475569 !important;
  transition: all .12s;
}
.tab-btn:hover { background: #f8fafc !important; }
.tab-btn.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  font-weight: 600;
}

@media (max-width: 900px) {
  .admin-sidebar { width: 64px; }
  .admin-sidebar .nav-item span:not(.nav-icon) { display: none; }
  .admin-sidebar .brand-text, .me-name, .me-role { display: none; }
  .admin-main { padding: 18px 14px 40px; }
  .dash-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
