/* ==========================================================================
   기본 리셋 & 공통 컴포넌트
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ==========================================================================
   브랜드
   ========================================================================== */
.brand {
  display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  width: 30px; height: 30px;
  background: var(--navy-800);
  border-radius: 7px;
  display: grid; place-items: center;
  color: white;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.02em;
  position: relative;
  flex-shrink: 0;
}
.brand-mark::after {
  content: '';
  position: absolute;
  right: -3px; top: 4px;
  width: 5px; height: 5px;
  background: var(--red-600);
  border-radius: 50%;
}
.brand-mark.sm {
  width: 28px; height: 28px;
  border-radius: 6px;
}
.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   버튼
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn i { width: 15px; height: 15px; transition: transform .15s; }

.btn-ghost { color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-50); color: var(--ink-900); }

.btn-secondary {
  color: var(--ink-900);
  background: var(--surface);
  border-color: var(--ink-200);
}
.btn-secondary:hover { background: var(--ink-50); border-color: var(--ink-300); }

.btn-primary {
  color: white;
  background: var(--navy-800);
}
.btn-primary:hover { background: var(--navy-900); }
.btn-primary:hover i { transform: translateX(2px); }

.btn-danger {
  color: white;
  background: var(--red-600);
}
.btn-danger:hover { filter: brightness(0.95); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-xl { padding: 16px 30px; font-size: 16px; }

.btn-icon {
  padding: 7px;
  color: var(--ink-500);
  border-radius: var(--radius);
}
.btn-icon:hover { background: var(--ink-50); color: var(--ink-900); }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--ink-500);
  transition: background .12s, color .12s;
  position: relative;
}
.icon-btn:hover { background: var(--ink-50); color: var(--ink-900); }
.icon-btn i { width: 18px; height: 18px; }

/* ==========================================================================
   아바타
   ========================================================================== */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, #5B7DAA, #1F3A5F);
  color: white;
  display: grid; place-items: center;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }

/* ==========================================================================
   칩 / 배지
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-700);
  white-space: nowrap;
}
.chip i { width: 11px; height: 11px; }
.chip.green { background: #E6F4EE; color: var(--green); }
.chip.amber { background: #FCF1DE; color: var(--amber); }
.chip.red   { background: var(--red-50); color: var(--red-600); }
.chip.navy  { background: var(--navy-50); color: var(--navy-800); }
.chip.purple { background: #F0E7FE; color: var(--purple); }

/* ==========================================================================
   입력 폼 공통
   ========================================================================== */
.input-text, .input-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  background: var(--surface);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input-text:focus, .input-select:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(31, 58, 95, 0.08);
}

textarea.input-text {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.input-select {
  padding-right: 32px;
  background: var(--surface) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6" fill="none"><path d="M1 1l4 4 4-4" stroke="%235A6478" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
  font-weight: 500;
}

/* ==========================================================================
   토글 스위치
   ========================================================================== */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; inset: 0;
  background: var(--ink-200);
  border-radius: 999px;
  transition: background .15s;
  cursor: pointer;
}
.toggle .slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.toggle input:checked + .slider { background: var(--navy-800); }
.toggle input:checked + .slider::before { transform: translateX(18px); }
