/* 라파선교회 관리자 UI — 브랜드 토큰 기반 대시보드 */
:root {
  --a-accent: #209DCB; --a-deep: #17789D; --a-ink: #303236; --a-text: #4B4E53;
  --a-muted: #7E8082; --a-line: #E5E6E8; --a-bg: #F5F6F7; --a-card: #FFFFFF;
  --a-danger: #C0392B; --a-ok: #1E8E5A;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif; background: var(--a-bg); color: var(--a-text); line-height: 1.6; }
a { color: var(--a-deep); text-decoration: none; }
button { font-family: inherit; }

/* 로그인 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #17789D, #209DCB); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 10px; padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; }
.login-card h1 { font-size: 20px; color: var(--a-ink); }
.login-card .sub { font-size: 13px; color: var(--a-muted); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--a-ink); }
.field input, .field select, .field textarea {
  border: 1px solid var(--a-line); border-radius: 6px; padding: 11px 14px; font-size: 15px; font-family: inherit; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--a-accent); outline-offset: 0; border-color: var(--a-accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 22px; border: none; border-radius: 6px; font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-primary { background: var(--a-accent); color: #fff; }
.btn-primary:hover { background: var(--a-deep); }
.btn-ghost { background: #fff; border: 1px solid var(--a-line); color: var(--a-text); font-weight: 500; }
.btn-danger { background: #fff; border: 1px solid #E7C3BE; color: var(--a-danger); font-weight: 500; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.msg { padding: 12px 16px; border-radius: 6px; font-size: 14px; }
.msg-error { background: #FBEDEB; color: var(--a-danger); }
.msg-ok { background: #E8F6EF; color: var(--a-ok); }

/* 레이아웃 */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--a-ink); color: rgba(255,255,255,0.75); display: flex; flex-direction: column; padding: 22px 0; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 0 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 14px; }
.side .brand strong { display: block; font-size: 17px; color: #fff; }
.side .brand span { font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,0.5); }
.side nav { display: flex; flex-direction: column; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 12px 22px; color: rgba(255,255,255,0.75); font-size: 14px; }
.side nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.side nav a.on { background: var(--a-deep); color: #fff; font-weight: 500; }
.side .foot { margin-top: auto; padding: 18px 22px 0; border-top: 1px solid rgba(255,255,255,0.12); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.side .foot a { color: rgba(255,255,255,0.6); }
.side .foot a:hover { color: #fff; }
.mainwrap { display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border-bottom: 1px solid var(--a-line); padding: 0 28px; height: 62px; }
.topbar h1 { font-size: 18px; color: var(--a-ink); }
.topbar .who { font-size: 13px; color: var(--a-muted); }
.content { padding: 28px; display: flex; flex-direction: column; gap: 24px; max-width: 1180px; width: 100%; }

/* 대시보드 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat { background: var(--a-card); border: 1px solid var(--a-line); border-radius: 10px; padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.stat .k { font-size: 13px; color: var(--a-muted); }
.stat .v { font-size: 28px; font-weight: 900; color: var(--a-ink); }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--a-muted); }
.stat.accent { border-top: 3px solid var(--a-accent); }
.panel { background: var(--a-card); border: 1px solid var(--a-line); border-radius: 10px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--a-line); }
.panel-head h2 { font-size: 15px; color: var(--a-ink); }
.panel-body { padding: 22px; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; }

/* 테이블 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 14px; background: #FAFBFB; border-bottom: 1px solid var(--a-line); color: var(--a-muted); font-weight: 500; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--a-line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
td .title-link { color: var(--a-ink); font-weight: 500; }
td .title-link:hover { color: var(--a-deep); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; background: #EAF6FB; color: var(--a-deep); }
.tag.off { background: #F1F2F3; color: var(--a-muted); }

/* 폼 */
.form-grid { display: flex; flex-direction: column; gap: 18px; max-width: 820px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea.body-input { min-height: 340px; line-height: 1.9; resize: vertical; }
.img-list { display: flex; gap: 12px; flex-wrap: wrap; }
.img-list .item { position: relative; width: 130px; }
.img-list img { width: 130px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--a-line); display: block; }
.img-list .item label { position: static; display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--a-muted); margin-top: 5px; }
.hint { font-size: 12px; color: var(--a-muted); }

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px; }
  .side .brand { border: none; padding: 6px 12px; margin: 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side nav a { padding: 8px 12px; border-radius: 6px; }
  .side .foot { margin: 0; border: none; padding: 6px 12px; flex-direction: row; }
  .form-row-2 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
