/* ── 기본 리셋 ── */
* { box-sizing: border-box; }
html { font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body {
  font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  background-color: #EFF2F7;
  color: #111827;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  letter-spacing: -0.02em;
}
input, select, textarea, button { font-family: inherit; }

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── 스피너 ── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(13,31,60,0.15);
  border-top-color: #0D1F3C;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #0D1F3C; color: white; padding: 12px 24px; border-radius: 100px;
  font-size: 14px; z-index: 9999; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  animation: slideDown 0.3s ease;
  max-width: 90vw; text-align: center;
}
.toast.success { background: #16A34A; }
.toast.error   { background: #DC2626; }
.toast.warning { background: #D97706; }
@keyframes slideDown { from { opacity: 0; top: 0; } to { opacity: 1; top: 20px; } }

/* ── 카드 ── */
.card {
  background: white;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
  padding: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  color: #0D1F3C;
}

/* ── 테이블 ── */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table thead th {
  background: #F8FAFC;
  color: #64748B;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #E2E8F0;
  white-space: nowrap;
  font-size: 12px;
}
.data-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: #F8FAFC; }
.data-table tbody tr.clickable { cursor: pointer; }
.td-clip {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 칩 ── */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.chip-ok   { background: #D1FAE5; color: #065F46; }
.chip-err  { background: #FEE2E2; color: #991B1B; }
.chip-blue { background: #DBEAFE; color: #1E40AF; }
.chip-gray { background: #F1F5F9; color: #64748B; }
.chip-off  { background: #F1F5F9; color: #94A3B8; }

/* ── 버튼 ── */
.btn-primary {
  padding: 10px 22px;
  background: #0D1F3C;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1A3A6B; }
.btn-ghost {
  padding: 10px 18px;
  background: white;
  color: #64748B;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
}
.btn-ghost:hover { border-color: #94A3B8; }
.btn-danger {
  padding: 10px 18px;
  background: #FEE2E2;
  color: #DC2626;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-sm {
  padding: 6px 14px !important;
  font-size: 12px !important;
}

/* ── 폼 ── */
.form-section {
  background: white;
  border-radius: 12px;
  padding: 22px 24px;
  border: 1px solid #E2E8F0;
  margin-bottom: 14px;
}
.section-title {
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  background: white;
}
.form-input:focus { border-color: #1D4ED8; }
.form-input[readonly] { background: #F8FAFC; cursor: default; }
.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: white;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 10px center;
  background-repeat: no-repeat;
  background-size: 18px;
  padding-right: 32px;
}
.form-select:focus { border-color: #1D4ED8; }

/* ── 그리드 ── */
.form-grid-1 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 14px; }

/* ── 알림 배지 ── */
.alert-badge {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.alert-badge.ok   { background: #D1FAE5; border: 1px solid #6EE7B7; color: #065F46; }
.alert-badge.warn { background: #FEF3C7; border: 1px solid #FCD34D; color: #92400E; }
.alert-badge.err  { background: #FEE2E2; border: 1px solid #FCA5A5; color: #991B1B; }

/* ── 요약 칩 ── */
.summary-chip {
  background: white;
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid #E2E8F0;
  font-size: 13px;
  color: #64748B;
}
.summary-chip b { color: #0D1F3C; }

/* ── 모달 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  width: 400px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

/* ── 플레이스홀더 ── */
.loading-ph {
  color: #94A3B8;
  font-size: 13px;
  padding: 48px 0;
  text-align: center;
}
.empty-msg {
  color: #94A3B8;
  font-size: 13px;
  padding: 32px;
  text-align: center;
}
.err-msg {
  color: #DC2626;
  font-size: 13px;
  padding: 20px 24px;
  background: white;
  border-radius: 12px;
}
