/* ── 해관회 공통 스타일 ───────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
  --bg: #F5F0E8;
  --gold: #9A7B2E;
  --gold-light: #C4A44A;
  --gold-bright: #B8972E;
  --text: #1A2A3A;
  --slate: #1B3A6B;
  --slate-light: #2C5282;
  --muted: #6B7280;
  --danger: #C0392B;
  --success: #1E7E4A;
  --border: rgba(154,123,46,0.25);
  --card-bg: rgba(255,255,255,0.75);
  --radius: 12px;
  --shadow: 0 4px 20px rgba(26,42,58,0.12);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

h1,h2,h3,h4,h5 {
  font-family: 'Noto Serif KR', serif;
  color: var(--text);
  line-height: 1.4;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ── 네브바 ── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(245,240,232,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.navbar-brand {
  font-family: 'Noto Serif KR', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
}
.navbar-brand span { font-size: 13px; color: var(--muted); font-family: 'Noto Sans KR',sans-serif; font-weight: 400; }
.navbar-nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; overflow: hidden; }
.navbar-nav a {
  color: var(--text2); padding: 5px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap;
}
  color: var(--text); padding: 6px 12px; border-radius: 6px;
  font-size: 14px; transition: all .2s;
}
.navbar-nav a:hover, .navbar-nav a.active {
  background: rgba(184,151,46,0.15); color: var(--gold);
}
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-user .badge {
  background: var(--gold); color: #000; font-size: 11px;
  padding: 2px 8px; border-radius: 20px; font-weight: 700;
}

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif; font-size: 14px; font-weight: 500;
  transition: all .2s; text-decoration: none;
}
.btn-gold {
  background: var(--gold); color: #0D1B2A; font-weight: 700;
}
.btn-gold:hover { background: var(--gold-light); color: #fff; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-outline:hover { background: rgba(184,151,46,0.1); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-slate { background: var(--slate-light); color: var(--text); }
.btn-slate:hover { background: #4e6780; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── 카드 ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 18px; font-weight: 600;
  color: var(--gold); margin-bottom: 16px;
}

/* ── 폼 ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 11px 14px;
  background: rgba(44,62,80,0.6);
  border: 1px solid rgba(184,151,46,0.2);
  border-radius: 8px; color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 14px; transition: border .2s;
}
.form-control:focus {
  outline: none; border-color: var(--gold);
  background: rgba(245,240,232,0.95);
}
.form-control::placeholder { color: var(--muted); }
select.form-control option { background: var(--slate); }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── 테이블 ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  background: rgba(184,151,46,0.15); color: var(--gold);
  font-family: 'Noto Serif KR', serif; font-weight: 600;
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td {
  padding: 11px 16px; border-bottom: 1px solid rgba(44,62,80,0.5);
  vertical-align: middle;
}
tr:hover td { background: rgba(200,190,170,0.3); }
tr:last-child td { border-bottom: none; }

/* ── 탭 ── */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab-btn {
  padding: 10px 20px; border: none; background: none;
  color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: 'Noto Sans KR', sans-serif; transition: all .2s;
}
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn:hover { color: var(--text); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── 모달 ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: #162333; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 20px; font-weight: 600; color: var(--gold);
  margin-bottom: 20px;
}
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── 배지 ── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge-gold { background: rgba(184,151,46,0.2); color: var(--gold); border: 1px solid rgba(184,151,46,0.3); }
.badge-success { background: rgba(39,174,96,0.2); color: #2ecc71; }
.badge-danger { background: rgba(192,57,43,0.2); color: #e74c3c; }
.badge-muted { background: rgba(138,155,176,0.2); color: var(--muted); }

/* ── 섹션 ── */
.section { padding: 40px 20px; max-width: 900px; margin: 0 auto; }
.page-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 26px; font-weight: 700; color: var(--gold);
  margin-bottom: 8px;
}
.page-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 28px; }

/* ── 바텀 네브 (모바일) ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(245,240,232,0.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 8px 4px;
  color: var(--muted); font-size: 10px; gap: 3px;
  text-decoration: none; transition: color .2s;
}
.bottom-nav a.active, .bottom-nav a:hover { color: var(--gold); }
.bottom-nav svg { width: 22px; height: 22px; }
.has-bottom-nav { padding-bottom: 70px; }

/* ── 토스트 ── */
#toast-container {
  position: fixed; top: 70px; right: 16px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 18px; border-radius: 8px; font-size: 14px;
  max-width: 280px; animation: slideIn .3s ease;
  box-shadow: var(--shadow);
}
.toast-success { background: #1a4a2e; border-left: 3px solid var(--success); color: #2ecc71; }
.toast-error { background: #3d1a1a; border-left: 3px solid var(--danger); color: #e74c3c; }
.toast-info { background: #1a2d3d; border-left: 3px solid var(--gold); color: var(--gold); }

@keyframes slideIn { from { transform: translateX(100%); opacity:0 } to { transform: translateX(0); opacity:1 } }

/* ── 로딩 ── */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(184,151,46,0.3);
  border-top-color: var(--gold);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.loading-center {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; gap: 12px; color: var(--muted);
}

/* ── 유틸 ── */
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.text-danger { color: #e74c3c; }
.text-success { color: #2ecc71; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── 반응형 ── */
@media (max-width: 600px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .navbar-nav { display: none; }
  .card { padding: 18px; }
  .section { padding: 24px 16px; }
  th, td { padding: 9px 10px; font-size: 13px; }
  /* 모바일에서 네브바 이름 숨김 → 버튼만 */
  .nav-name-hide { display: none !important; }
}
