:root { --blue: #0b6fa4; --bg: #f2f6f9; --border: #d5dde3; --err: #c0392b; --ok: #1e7d4f; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; background: var(--bg); color: #222; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
          background: var(--blue); color: #fff; padding: 10px 20px; }
.topbar h1 { margin: 0; font-size: 18px; }
.topbar form { display: flex; align-items: center; gap: 10px; margin: 0; }
.topbar button { background: #fff; color: var(--blue); border: 0; border-radius: 4px; padding: 6px 12px; cursor: pointer; }
main { max-width: 1000px; margin: 20px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: bold; }
input, select { font: inherit; font-weight: normal; padding: 8px; border: 1px solid var(--border); border-radius: 4px; }
.wide { grid-column: 1 / -1; }
.btn { background: var(--blue); color: #fff; border: 0; border-radius: 4px; padding: 9px 20px; font: inherit; cursor: pointer; margin-top: 12px; }
.error { color: var(--err); font-size: 13px; font-weight: normal; }
.message { background: #e8f5ee; color: var(--ok); border: 1px solid #b9dfc9; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
th { background: #eaf1f6; }
td.num, th.num { text-align: right; }
.empty { color: #777; padding: 16px 0; }
.login-box { max-width: 360px; margin: 80px auto; }
.btn.cancel { display: inline-block; background: #7b8a96; text-decoration: none; margin-left: 8px; }
td.name-cell { cursor: pointer; user-select: none; }
td.name-cell:hover { background: #eef6fb; color: var(--blue); }
.hint { color: #777; font-weight: normal; margin-left: 8px; }
.topbar .menu { display: flex; gap: 4px; margin-right: auto; margin-left: 24px; }
.topbar .menu a { color: #fff; text-decoration: none; padding: 7px 14px; border-radius: 4px; font-size: 14px; }
.topbar .menu a:hover { background: rgba(255,255,255,.18); }
.topbar .menu a.on { background: #fff; color: var(--blue); font-weight: bold; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label.check input { width: auto; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
@media (max-width: 700px) { .picker { grid-template-columns: 1fr; } }
.picker h3 { margin: 0 0 8px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; min-height: 40px; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 6px 12px; cursor: pointer; font: inherit; }
.chip:hover { background: #eef6fb; }
.chip.on { background: #fff8c5; border-color: #e0cf55; }
ol.ordered { counter-reset: n; }
ol.ordered li { counter-increment: n; }
ol.ordered li::before { content: counter(n) "."; font-size: 12px; color: #777; margin-right: 2px; }
table.center th, table.center td { text-align: center; }
td.wrap { white-space: normal; }
input.score { width: 70px; text-align: center; }
a.mini, button.mini { display: inline-block; font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--blue);
  background: #fff; color: var(--blue); border-radius: 4px; cursor: pointer; text-decoration: none; }
button.mini.danger { border-color: var(--err); color: var(--err); }
.label { display: inline-block; font-size: 12px; background: #eaf1f6; color: var(--blue); border-radius: 4px; padding: 2px 8px; margin-right: 6px; vertical-align: middle; }
.done { display: inline-block; font-size: 13px; color: #fff; background: #7b8a96; border-radius: 4px; padding: 4px 10px; }
td.name-cell.locked { cursor: not-allowed; color: #777; }
td.name-cell.locked:hover { background: transparent; color: #777; }
form.search { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
form.search input { flex: 0 1 320px; }
form.search .btn { margin-top: 0; }
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th:hover { background: #dbe8f1; }
table.center td.left { text-align: left; }
.grid1 { display: grid; grid-template-columns: 1fr; gap: 12px; }
textarea { font: inherit; font-weight: normal; padding: 8px; border: 1px solid var(--border); border-radius: 4px; resize: vertical; }
.post-body { white-space: pre-wrap; word-break: break-word; line-height: 1.6; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 140px; }
.post-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.post-actions form { margin: 0; }
.btn.danger { background: var(--err); }
.paging { text-align: center; margin-top: 16px; font-size: 14px; }
.paging a, .paging strong { display: inline-block; margin: 0 3px; padding: 4px 9px; border-radius: 4px; }
.paging a { color: var(--blue); text-decoration: none; border: 1px solid var(--border); }
.paging strong { background: var(--blue); color: #fff; }
td.wrap a { color: #222; text-decoration: none; }
td.wrap a:hover { color: var(--blue); text-decoration: underline; }
/* 상단 메뉴: 경기등록 (하위 메뉴). 마우스를 올리거나 눌러서(터치) 열린다. */
.topbar .menu .group { position: relative; outline: none; }
.topbar .menu .group .parent { display: inline-block; color: #fff; padding: 7px 14px; border-radius: 4px; font-size: 14px; cursor: pointer; user-select: none; }
.topbar .menu .group:hover .parent, .topbar .menu .group:focus-within .parent { background: rgba(255,255,255,.18); }
.topbar .menu .group .parent.on { background: #fff; color: var(--blue); font-weight: bold; }
.topbar .menu .submenu { display: none; position: absolute; top: 100%; left: 0; min-width: 160px; z-index: 20;
  flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15); padding: 4px; }
.topbar .menu .group:hover .submenu, .topbar .menu .group:focus-within .submenu { display: flex; }
.topbar .menu .submenu a { color: #222; padding: 8px 12px; border-radius: 4px; font-size: 14px; white-space: nowrap; }
.topbar .menu .submenu a:hover { background: #eef6fb; color: var(--blue); }
.topbar .menu .submenu a.on { background: #eaf1f6; color: var(--blue); font-weight: bold; }
tfoot th { background: #eaf1f6; border-top: 2px solid var(--border); }
form.search select { font: inherit; padding: 8px; border: 1px solid var(--border); border-radius: 4px; }

/* 회비입금 현황: 납입율 막대 */
.bar { position: relative; min-width: 120px; height: 18px; background: #e5e7eb; border-radius: 9px; overflow: hidden; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; background: #4f9d69; }
.bar em { position: relative; display: block; text-align: center; font-size: 12px; font-style: normal; line-height: 18px; }

/* 월별회계 인쇄 */
@media print {
	.topbar, .no-print { display: none !important; }
	body { background: #fff; }
	.card { box-shadow: none; border: 0; padding: 0; }
	.print-title { text-align: center; }
	table { font-size: 12px; }
}

td.pname { cursor: pointer; user-select: none; }

/* 인쇄할 때도 납입율 막대의 배경색이 나오도록 */
.bar, .bar span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* 두 단계 메뉴: 경기 > KDK 대회 / 복식 대회 > 항목 */
.topbar .menu .subgroup { position: relative; }
.topbar .menu .subparent { display: block; color: #222; padding: 8px 12px; border-radius: 4px; font-size: 14px; cursor: default; white-space: nowrap; user-select: none; }
.topbar .menu .subgroup:hover > .subparent, .topbar .menu .subgroup:focus-within > .subparent { background: #eef6fb; color: var(--blue); }
.topbar .menu .subparent.on { background: #eaf1f6; color: var(--blue); font-weight: bold; }
.topbar .menu .subsub { display: none; position: absolute; top: 0; left: 100%; min-width: 150px; z-index: 30; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.topbar .menu .subgroup:hover > .subsub, .topbar .menu .subgroup:focus-within > .subsub { display: flex; }
.topbar .menu .subsub a { color: #222; padding: 8px 12px; border-radius: 4px; font-size: 14px; white-space: nowrap; text-decoration: none; }
.topbar .menu .subsub a:hover { background: #eef6fb; color: var(--blue); }
.topbar .menu .subsub a.on { background: #eaf1f6; color: var(--blue); font-weight: bold; }

/* 복식 대회: 타원형 상자로 보여 주는 팀·조 */
.oval-list { display: flex; flex-wrap: wrap; gap: 2px 6px; margin: 4px 0 8px; }
.team-box { display: flex; flex-direction: column; gap: 0; }
.team-oval { display: inline-flex; align-items: center; gap: 8px; border: 2px solid #8fc1dd; background: #eef7fc;
  border-radius: 999px; padding: 6px 16px; margin: 0; }
.member-oval { background: #fff; border: 1px solid #b9d7ea; border-radius: 999px; padding: 4px 14px; font-size: 14px; }
.team-amp { color: #6a8da3; font-weight: bold; }
.team-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; padding-left: 10px; }
details.replace summary { cursor: pointer; font-size: 13px; color: var(--blue); }
details.replace form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
details.replace select, details.replace input[type=text] { font: inherit; font-size: 13px; padding: 4px 8px; }
.group-wrap { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 12px; }
.group-box { border: 2px solid #a9d3c0; background: #f2fbf6; border-radius: 26px; padding: 14px 18px; min-width: 260px; }
.group-title { font-weight: bold; color: #1e7d4f; margin-bottom: 6px; font-size: 16px; }
.group-box .team-oval { display: flex; justify-content: center; border-color: #a9d3c0; background: #fff; }
.group-box .member-oval { background: #f2fbf6; border-color: #cfe7db; }
.team-line { display: flex; align-items: center; gap: 8px; }
.team-no { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: bold; font-size: 14px; }
/* 조별 경기·순위 제목: 옅은 색 띠 */
.title-band { background: #e8f3fa; border-left: 4px solid #8fc1dd; border-radius: 6px; padding: 8px 12px; }
.title-band.rank { background: #eef8f1; border-left-color: #a9d3c0; font-size: 15px; margin-top: 18px; }
.title-band .hint { margin-left: 10px; }
/* 예선과 본선을 나누는 띠 (두께 5mm) */
.stage-divider { height: 5mm; background: #8fc3ea; border-radius: 6px; margin: 0 0 20px; }
/* 참가 팀 목록: 번호는 연한 파란 동그라미, 회원명은 타원, ":"는 글자만 */
.oval-list { flex-direction: column; flex-wrap: nowrap; gap: 2px; }
.oval-list .team-no { background: #dbeefa; color: #1f5f8b; border: 1px solid #8fc1dd; border-radius: 50%; min-width: 26px; height: 26px; font-size: 14px; justify-content: center; }
.oval-list .team-oval { border: 0; background: none; border-radius: 0; padding: 0; gap: 6px; }
.oval-list .member-oval { border: 1px solid #8fc1dd; background: #eef7fc; border-radius: 999px; padding: 3px 14px; font-size: 15px; }
.oval-list .team-amp { font-weight: normal; color: inherit; }

/* 활동 사진 */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo-item { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.photo-item a.thumb { display: block; aspect-ratio: 4 / 3; background: #f0f3f5; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .info { padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.photo-item .info strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-item .info .meta { color: #777; font-size: 12px; }
.photo-item form { margin: 0; padding: 0 10px 8px; }
.photo-item form .btn { margin-top: 4px; padding: 4px 12px; font-size: 12px; }
.photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-preview img { width: 110px; height: 85px; object-fit: cover; border: 1px solid var(--border); border-radius: 4px; }

/* 사진 크게 보기 */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 88vw; max-height: 94vh; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lightbox img { max-width: 88vw; max-height: 80vh; object-fit: contain; border-radius: 4px; background: #111; }
.lightbox figcaption { color: #fff; text-align: center; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.lightbox figcaption small { color: #bbb; }
.lightbox button { position: absolute; background: rgba(255,255,255,.15); color: #fff; border: 0; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 22px; }
.lightbox button:hover { background: rgba(255,255,255,.3); }
.lightbox .lb-close { top: 16px; right: 20px; font-size: 30px; line-height: 1; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.photo-item a.thumb { position: relative; }
.photo-item .count { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.lightbox figcaption em { font-style: normal; color: #9fd0ff; font-size: 13px; }
.add-photos { margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--border); }
.add-photos label { display: flex; flex-direction: column; gap: 6px; font-weight: bold; }
.add-photos label small { font-weight: normal; color: #777; }

/* 제목 박스 (옅은 색) */
.card h2.title-box { background: #e8f2fb; border: 1px solid #b9d6ee; border-radius: 6px; padding: 10px 14px; color: #1f4e79; }
.card h2.title-box small { color: #4a78a3; font-weight: normal; }

/* 기초 등록: 항목·메모 입력란과 추가/수정/삭제 버튼 */
.base-fields { display: flex; gap: 12px; align-items: flex-start; }
.base-fields .base-name { flex: 0 0 calc((100% - 24px) / 6); min-width: 130px; }
.base-fields .base-memo { flex: 1 1 auto; min-width: 0; }
.base-fields input { width: 100%; box-sizing: border-box; }
.base-buttons { display: flex; gap: 8px; }
.base-buttons .btn { margin-top: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
tr.base-row { cursor: pointer; user-select: none; }
tr.base-row:hover td { background: #f4f9fc; }
tr.base-row.selected td { background: #e3f0fa; }

/* 회원: 사용 안 함 */
tr.inactive td { color: #999; background: #fafafa; }
.home-card { text-align: center; }
.home-art { width: 100%; max-width: 600px; height: auto; }
.home-owner { margin: 14px 0 0; font-size: 15px; color: #555; }
.home-notice { margin: 18px auto 0; max-width: 560px; line-height: 1.7; font-size: 15px; }
.home-notice p { margin: 4px 0; }
.home-notice a { color: var(--blue); font-weight: bold; }
.home-photo { width: 100%; max-width: 760px; height: auto; border-radius: 10px; display: block; margin: 0 auto; }
