:root {
  --ink: #102a33;
  --muted: #67767c;
  --line: #dce3df;
  --paper: #ffffff;
  --canvas: #f5f7f4;
  --brand: #22684f;
  --brand-dark: #174b3a;
  --danger: #c43c32;
  --warning: #9a6700;
  --sidebar: #112d34;
  --radius: 14px;
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; background: var(--paper); }
.skip-link:focus { top: 1rem; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.login-wrap { width: min(100%, 460px); }
.brand { margin-bottom: 2rem; text-align: center; font-size: 2rem; font-weight: 900; letter-spacing: .2em; }
.brand small { display: block; margin-top: .5rem; color: var(--muted); font-size: .67rem; letter-spacing: .36em; }
.login-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 18px 50px rgb(16 42 51 / 8%); }
.login-card { padding: 2.25rem; }
.eyebrow { margin: 0 0 .75rem; color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2rem); }
.lead { margin: .75rem 0 2rem; color: var(--muted); }
.field { display: grid; gap: .5rem; margin-top: 1.15rem; }
.field label { font-size: .88rem; font-weight: 700; }
.field input, .toolbar input, .toolbar select { min-height: 44px; border: 1px solid #cbd6d0; border-radius: 8px; padding: .7rem .8rem; background: #fff; color: var(--ink); }
.field input:focus, .toolbar input:focus, .toolbar select:focus { outline: 3px solid rgb(34 104 79 / 16%); border-color: var(--brand); }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; border: 0; border-radius: 8px; padding: .7rem 1rem; cursor: pointer; font-weight: 800; }
.button-primary { color: #fff; background: var(--brand); }
.button-primary:hover { background: var(--brand-dark); }
.button-block { width: 100%; margin-top: 1.5rem; }
.alert { margin: 1rem 0; border-radius: 8px; padding: .8rem 1rem; font-size: .9rem; }
.alert-error { color: #8a241d; background: #fff0ee; }
.login-footnote { margin-top: 1.5rem; color: var(--muted); text-align: center; font-size: .78rem; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.5rem 1rem; color: #dbe9e3; background: var(--sidebar); }
.sidebar .brand { margin: 0 0 2rem; color: #fff; font-size: 1.25rem; text-align: left; }
.nav-group { margin-top: 1.5rem; }
.nav-label { margin: 0 .75rem .45rem; color: #86a49a; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-list { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.nav-link { display: block; border-radius: 8px; padding: .72rem .75rem; color: #cde0d8; font-size: .9rem; }
.nav-link:hover, .nav-link.is-active { color: #fff; background: rgb(255 255 255 / 10%); }
.main { min-width: 0; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: 0 2rem; background: rgb(255 255 255 / 88%); }
.topbar-meta { color: var(--muted); font-size: .85rem; }
.logout-form { margin: 0; }
.link-button { border: 0; padding: .5rem; color: var(--brand); background: none; cursor: pointer; font-weight: 800; }
.content { width: min(100%, 1440px); margin: 0 auto; padding: 2rem; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head p { margin: .5rem 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat { padding: 1.25rem; }
.stat-label { color: var(--muted); font-size: .82rem; }
.stat-value { margin-top: .7rem; font-size: 1.8rem; font-weight: 900; }
.stat-link { display: block; transition: border-color .15s ease, transform .15s ease; }
.stat-link:hover, .stat-link:focus-visible { border-color: var(--brand); transform: translateY(-2px); }
.quick-links { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.panel { margin-top: 1rem; padding: 1.25rem; box-shadow: none; }
.panel h2 { margin: 0 0 .5rem; font-size: 1.08rem; }
.panel p { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: .85rem; text-align: left; white-space: nowrap; }
.data-table th { color: var(--muted); background: #f8faf8; font-size: .78rem; }
.empty-cell { padding: 3rem 1rem !important; color: var(--muted); text-align: center !important; }
.pagination { display: flex; gap: .35rem; justify-content: center; margin-top: 1.25rem; }
.pagination a, .pagination span { min-width: 36px; min-height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.pagination .current { border-color: var(--brand); color: #fff; background: var(--brand); }
.status-note { display: inline-flex; border-radius: 999px; padding: .3rem .6rem; color: var(--warning); background: #fff6d8; font-size: .75rem; font-weight: 800; }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar, .content { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 560px) {
  .login-card { padding: 1.4rem; }
  .stats { grid-template-columns: 1fr; }
  .page-head, .topbar { align-items: flex-start; flex-direction: column; }
  .topbar { padding-top: 1rem; padding-bottom: 1rem; }
}

/* Artist management */
.alert-success { color: #174b3a; background: #e9f7f0; }
.alert-warning { color: #775100; background: #fff6d8; }
.alert ul { margin-bottom: 0; }
.button-secondary { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.actions, .form-row, .image-field { display: flex; align-items: center; gap: .75rem; }
.filter-grid { align-items: end; }
.field.compact { min-width: 130px; margin-top: 0; }
.field.compact:first-child { min-width: 220px; flex: 1; }
.entity { display: inline-flex; align-items: center; gap: .75rem; }
.entity small { display: block; margin-top: .2rem; color: var(--muted); }
.avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 8px; object-fit: cover; background: #eef2ef; }
.avatar-fallback { display: grid; place-items: center; font-weight: 900; }
.badge { display: inline-flex; border-radius: 999px; padding: .3rem .55rem; font-size: .74rem; font-weight: 800; }
.badge-approve-1 { color: #17603f; background: #e5f6ed; }
.badge-approve-2 { color: #855d00; background: #fff4ce; }
.badge-approve-3 { color: #9a2f27; background: #ffeae7; }
.detail-grid { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.profile-panel { margin-top: 0; }
.profile-image { width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; object-fit: cover; background: #eef2ef; }
.profile-placeholder { display: grid; place-items: center; color: var(--muted); }
.detail-list { margin: 1.25rem 0 0; }
.detail-list div { display: grid; grid-template-columns: 90px 1fr; gap: .75rem; border-top: 1px solid var(--line); padding: .75rem 0; }
.detail-list dt { color: var(--muted); font-size: .8rem; }
.detail-list dd { margin: 0; }
.preline { white-space: pre-line; line-height: 1.75; }
.grow { flex: 1; }
.align-end { align-self: end; }
.form-section h2 { padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.field textarea, .field select { width: 100%; border: 1px solid #cbd6d0; border-radius: 8px; padding: .75rem; color: var(--ink); background: #fff; font: inherit; }
.field textarea { resize: vertical; line-height: 1.6; }
.field textarea:focus, .field select:focus { outline: 3px solid rgb(34 104 79 / 16%); border-color: var(--brand); }
.field small { color: var(--muted); }
.form-preview { width: 130px; aspect-ratio: 3 / 4; border-radius: 8px; object-fit: cover; }
.gallery-image { width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; object-fit: cover; background: #eef2ef; }
.gallery-form-preview { width: 220px; aspect-ratio: 16 / 10; border-radius: 8px; object-fit: cover; }
.exhibition-thumb { border-radius: 4px; object-fit: cover; }
.exhibition-image { width: 100%; aspect-ratio: 3 / 4; border-radius: 10px; object-fit: cover; background: #eef2ef; }
.exhibition-preview { width: 160px; aspect-ratio: 3 / 4; }
.exhibition-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.exhibition-gallery figure { margin: 0; }
.exhibition-gallery img { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; object-fit: cover; }
.exhibition-gallery figcaption { margin-top: .5rem; color: var(--muted); font-size: .82rem; }
.relation-field { position: relative; }
.relation-results { position: absolute; top: calc(100% - 1.2rem); z-index: 10; width: 100%; border-radius: 8px; background: #fff; box-shadow: 0 12px 32px rgb(16 42 51 / 18%); }
.relation-option { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: .75rem; text-align: left; background: #fff; cursor: pointer; }
.relation-option:hover, .relation-option:focus { background: #edf6f1; }
.selected-relations { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.relation-chip { display: inline-flex; border: 0; border-radius: 999px; padding: .45rem .7rem; color: var(--brand-dark); background: #e5f6ed; font: inherit; font-size: .82rem; cursor: pointer; }
.is-hidden { display: none !important; }
.banner-list-image { width: 72px; height: 42px; flex: 0 0 72px; border-radius: 5px; object-fit: cover; background: #eef2ef; }
.banner-form-preview { width: min(100%, 720px); max-height: 360px; border-radius: 8px; object-fit: contain; background: #101010; }
.banner-detail-image { width: 100%; max-height: 620px; border-radius: 10px; object-fit: contain; background: #101010; }
.notice-list-image { object-fit: cover; }
.notice-form-preview { width: min(100%, 360px); max-height: 460px; border-radius: 8px; object-fit: contain; background: #eef2ef; }
.notice-image { width: 100%; max-height: 520px; border-radius: 10px; object-fit: contain; background: #eef2ef; }
.notice-content { overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.75; }
.attachment-link { display: inline-flex; color: var(--brand); font-weight: 800; text-decoration: underline; }
.member-avatar { object-fit: cover; }
.member-profile-image { width: 100%; max-height: 360px; border-radius: 10px; object-fit: contain; background: #eef2ef; }
.privacy-note { padding: 12px; border-radius: 8px; background: #f5f7f5; color: var(--muted); font-size: .88rem; }
.member-metrics article { min-height: 112px; }
.consent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.member-notes { display: grid; gap: 12px; margin-top: 18px; }
.member-notes article { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfa; }
.member-notes header { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .86rem; }
.member-notes p { margin-bottom: 0; }
.badge-neutral { color: #3d4b46; background: #e9eeeb; }

@media (max-width: 720px) {
  .consent-grid { grid-template-columns: 1fr; }
  .member-notes header { align-items: flex-start; flex-direction: column; gap: 4px; }
}
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding: 1rem 0; background: rgb(245 247 244 / 94%); }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .exhibition-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .form-grid, .form-grid.thirds { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-row, .image-field { align-items: stretch; flex-direction: column; }
  .exhibition-gallery { grid-template-columns: 1fr; }
}
