/* ─────────────────────────────────────────────
   길동 생활축구회 · 총무 관리
   컨셉: 일요일 아침 운동장. 유니폼 파랑 + 분필 라인 + 전광판 숫자
   ───────────────────────────────────────────── */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&display=swap");

:root {
  /* Brand */
  --kit: #326fd1;          /* Primary */
  --kit-deep: #2459ad;     /* Hover */
  --kit-active: #1d4a8f;   /* Active */
  --sky: #eaf2ff;          /* Light */
  /* Background & Surface (밝은 바탕, 회색 대신 아주 옅은 파랑) */
  --paper: #ffffff;        /* Background */
  --sheet: #ffffff;        /* Surface */
  --line: #e3ebf7;         /* Border */
  --muted-bg: #f2f7ff;     /* Muted */
  /* Typography */
  --ink: #1a2440;          /* Primary Text */
  --muted: #5b6b8c;        /* Sub Text */
  --disabled: #a9b7d0;     /* Disabled */
  /* Status */
  --green: #27856a;        /* Success: 수입·접수중 */
  --green-tint: #e4f4ee;
  --amber: #c58a32;        /* Warning: 휴면 */
  --amber-tint: #fbf1e1;
  --red: #c45b5b;          /* Danger: 불참·지출·미납 */
  --red-tint: #fbeaea;
  /* 전광판: 홈 메인 카드·다가오는 경기 날짜·회원 링크 화면 상단에만 쓰는 강조색 (그 외 화면은 기존 파랑 유지) */
  --board: #15233f;        /* 전광판 남색 */
  --board-sub: #a9b6cf;    /* 전광판 위 보조 글자 */
  --board-line: rgba(255, 255, 255, .14);
  --lime: #c6f24e;         /* 형광 조끼 라임: 전광판 위에서만 글자색으로 */
  --lime-tint: #ecfbc4;    /* 흰 바탕 위 라임 배지 배경 */
  --lime-ink: #3d5a00;     /* 흰 바탕 위 라임 배지 글자 */

  --num: "Barlow Condensed", "Pretendard Variable", sans-serif;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--kit); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -0.025em; }
h3 { font-size: 16px; font-weight: 700; }
code { background: var(--sky); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.hidden { display: none !important; }
.num-font { font-family: var(--num); letter-spacing: 0; }

:focus-visible { outline: 3px solid color-mix(in srgb, var(--kit) 45%, transparent); outline-offset: 2px; }

/* ── 상단 바 ─────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--sheet); color: var(--ink); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 0 8px 0 18px;
}
.topbar .club { font-weight: 800; font-size: 17px; letter-spacing: -0.03em; }
.topbar .icon-btn { color: var(--kit); }
.icon-btn {
  width: 40px; height: 40px; border: 0; background: transparent; border-radius: 50%;
  display: inline-grid; place-items: center; cursor: pointer; padding: 0; color: inherit;
}
.icon-btn:hover { background: var(--sky); }
.icon-btn svg { width: 22px; height: 22px; }

/* ── 하단 탭바 (모바일) / 상단 탭 (PC) ─── */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--sheet); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
nav.tabs a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--disabled); font-size: 11.5px; font-weight: 600;
}
nav.tabs a svg { width: 24px; height: 24px; }
nav.tabs a.active { color: var(--kit); }

main {
  max-width: 880px; margin: 0 auto;
  padding: 18px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}
main.bare { max-width: none; padding: 0; }

@media (min-width: 860px) {
  nav.tabs {
    position: sticky; top: 54px; bottom: auto; height: 52px; padding: 0 max(16px, calc((100vw - 880px) / 2));
    display: flex; gap: 6px; border-top: 0; border-bottom: 1px solid var(--line);
  }
  nav.tabs a { flex-direction: row; font-size: 14.5px; gap: 7px; padding: 0 14px; position: relative; color: var(--muted); }
  nav.tabs a svg { width: 19px; height: 19px; }
  nav.tabs a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--kit); }
  main { padding-bottom: 48px; }
}

/* ── 페이지 머리 ─────────────────────── */
/* 제목 위치를 모든 화면에서 같게: 위쪽 기준 정렬 + 제목 줄 높이 = 오른쪽 버튼 높이(42px).
   (가운데 정렬이면 오른쪽 버튼·부제 유무에 따라 제목이 몇 px씩 오르내린다) */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head h2 { font-size: 24px; font-weight: 800; min-height: 42px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; line-height: 1.3; }
.page-head > :not(:first-child) { flex-shrink: 0; }
.page-head > button.small { margin-top: 4px; } /* 34px 버튼을 42px 제목 줄 가운데에 */
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: -2px; }
.page-head .sub + .sub { margin-top: 2px; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.back svg { width: 18px; height: 18px; }

/* ── 섹션 / 시트 ─────────────────────── */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 10px; }
.section-head a { font-size: 14px; font-weight: 600; }
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 18px; }
.sheet.pad { padding: 18px; }
.sheet + .sheet { margin-top: 12px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); font-size: 13.5px; }
.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty a { font-weight: 600; }

/* ── 홈: 전광판 ──────────────────────── */
.scoreboard {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--board); color: #fff; border-radius: 22px;
  padding: 22px 22px 18px;
}
/* 하프라인 + 센터서클 분필 라인 */
.scoreboard::before, .scoreboard::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.scoreboard::before {
  width: 230px; height: 230px; right: -70px; top: -40px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .08);
}
.scoreboard::after { top: 0; bottom: 0; right: 44px; width: 2px; background: rgba(255, 255, 255, .08); }
.sb-label { font-size: 14px; font-weight: 700; color: var(--lime); }
.sb-note { color: var(--board-sub); }
.sb-figure { font-family: var(--num); font-weight: 700; font-size: 60px; line-height: 1; margin: 6px 0 20px; letter-spacing: .005em; }
.sb-figure small { font-family: "Pretendard Variable", sans-serif; font-size: 22px; font-weight: 700; margin-left: 4px; }
.sb-figure.neg { color: var(--red); }
.sb-split { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--board-line); padding-top: 14px; }
.sb-split > div + div { border-left: 1px solid var(--board-line); padding-left: 16px; }
.sb-split span { display: block; font-size: 13px; color: var(--board-sub); }
.sb-split b { font-family: var(--num); font-size: 28px; font-weight: 700; letter-spacing: .01em; }
.sb-split b small { font-family: "Pretendard Variable", sans-serif; font-size: 14px; margin-left: 2px; }
.sb-split em { display: block; font-style: normal; font-size: 12px; color: var(--board-sub); }

/* ── 경기 카드 (매치데이) ─────────────── */
.fixture { display: flex; align-items: center; gap: 14px; padding: 14px 0; color: inherit; }
.fixture + .fixture { border-top: 1px solid var(--line); }
.fx-date {
  flex: none; width: 56px; text-align: center; border-radius: var(--r-md);
  background: var(--board); color: var(--board-sub); padding: 6px 0 5px; /* 다가오는 경기 = 작은 전광판 */
}
.fx-date b { color: var(--lime); }
.fx-date b { display: block; font-family: var(--num); font-size: 28px; line-height: 1; font-weight: 700; }
.fx-date span { font-size: 11.5px; font-weight: 700; }
.fixture.past .fx-date, .fixture.past .fx-date b { background: var(--muted-bg); color: var(--muted); } /* 지난 경기는 전광판 꺼짐 */
.fx-body { flex: 1; min-width: 0; }
.fx-body strong { display: block; font-size: 15.5px; font-weight: 700; }
.fx-body .meta { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-side { flex: none; text-align: right; }
.fx-count { font-family: var(--num); font-size: 24px; font-weight: 700; line-height: 1; }
.fx-count small { font-family: "Pretendard Variable", sans-serif; font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }

.next-match { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 18px 16px; }
.next-match .fixture { padding-bottom: 12px; }

/* 출석 막대 */
.bar { height: 6px; background: var(--muted-bg); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--kit); border-radius: 6px; }

/* ── 버튼 / 입력 ─────────────────────── */
button, .btn {
  font: inherit; font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em;
  border-radius: var(--r-md); border: 0; cursor: pointer;
  height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--sky); color: var(--kit);
}
button:hover { background: var(--muted-bg); }
button.primary { background: var(--kit); color: #fff; }
button.primary:hover { background: var(--kit-deep); }
button.primary:active { background: var(--kit-active); }
button.ghost { background: transparent; color: var(--muted); }
button.ghost:hover { background: var(--muted-bg); }
button.danger { background: var(--red-tint); color: var(--red); }
button.small { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
button.wide { width: 100%; }
button:disabled { background: var(--muted-bg); color: var(--disabled); cursor: default; }
button svg { width: 18px; height: 18px; }

input, select, textarea {
  font: inherit; font-size: 16px; /* iOS: 16px 미만이면 입력 시 화면 자동 확대 */
  color: var(--ink); width: 100%; height: 46px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: #fff;
}
textarea { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--kit); box-shadow: 0 0 0 3px var(--sky); }
input[readonly] { background: var(--paper); color: var(--muted); }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
label.check input { width: 20px; height: 20px; accent-color: var(--kit); }

/* 필터 칩 */
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.chips button { flex-shrink: 0; white-space: nowrap; height: 34px; border-radius: 999px; padding: 0 14px; background: var(--sheet); color: var(--muted); border: 1px solid var(--line); font-size: 13.5px; }
.chips button.on { background: var(--kit); color: #fff; border-color: var(--kit); }
.chips .chips-count { margin-left: auto; align-self: center; flex-shrink: 0; padding-left: 8px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
/* 탭 아래 한 줄 요약 (회비: 등급별 월 회비, 연 누적) */
.tab-info { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0 2px 12px; color: var(--muted); font-size: 13.5px; }
.tab-info b { color: var(--ink); }

/* ── 표 ──────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14.5px; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; padding-top: 12px; padding-bottom: 10px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--paper); }
.table-wrap { overflow-x: auto; }

/* 상태 배지 */
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--muted-bg); color: var(--muted); vertical-align: 1px; }
.badge.blue { background: var(--sky); color: var(--kit); }
.badge.green { background: var(--green-tint); color: var(--green); }
.badge.red { background: var(--red-tint); color: var(--red); }
.badge.amber { background: var(--amber-tint); color: var(--amber); }

/* 등번호 */
.jersey {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: inline-grid; place-items: center;
  font-family: var(--num); font-size: 19px; font-weight: 700; letter-spacing: 0;
  background: var(--sky); color: var(--kit);
}
.jersey.none { background: var(--muted-bg); color: var(--disabled); font-size: 15px; }

/* ── 출석부 (팀 시트) ────────────────── */
.tally { display: flex; gap: 18px; }
.tally div { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tally b { display: block; font-family: var(--num); font-size: 26px; line-height: 1.05; color: var(--ink); }
.tally .t-in b { color: var(--kit); }
.tally .t-out b { color: var(--red); }

.att-list { list-style: none; margin: 0; padding: 0; }
.att-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.att-list li:last-child { border-bottom: 0; }
.att-list .name { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; }
.att-list .name small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
/* 출석/불참: 미선택일 때도 두 버튼이 구분되도록 각각 테두리 + 간격 */
.seg { display: inline-flex; gap: 6px; flex-shrink: 0; }
.seg button { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; background: #fff; color: var(--muted); border: 1px solid var(--line); }
.seg button:hover { background: var(--muted-bg); color: var(--ink); border-color: #c9d8f0; }
.seg button.on[data-s="ATTEND"] { background: var(--kit); border-color: var(--kit); color: #fff; }
.seg button.on[data-s="ABSENT"] { background: var(--red); border-color: var(--red); color: #fff; }

.save-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index: 5;
  margin-top: 14px; display: flex; gap: 8px;
}
.save-bar button.primary { flex: 1; height: 50px; font-size: 16px; box-shadow: 0 8px 20px rgba(83, 109, 131, .3); }
@media (min-width: 860px) { .save-bar { bottom: 16px; } }

.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; }

/* ── 회비 현황표 ─────────────────────── */
.matrix th, .matrix td { text-align: center; padding: 7px 3px; font-size: 13px; border-bottom-color: var(--muted-bg); }
.matrix th { font-family: var(--num); font-size: 15px; color: var(--muted); }
.matrix th.now { color: var(--kit); }
.matrix td.name, .matrix th.name { text-align: left; position: sticky; left: 0; background: var(--sheet); white-space: nowrap; z-index: 1; padding-right: 12px; font-family: inherit; box-shadow: 8px 0 8px -8px rgba(31, 41, 55, .18); }
.matrix td.name { font-weight: 700; font-size: 14px; }
.matrix tfoot th { font-size: 16px; color: var(--ink); border-bottom: 0; }
.cell {
  width: 30px; height: 30px; border-radius: 9px; padding: 0; vertical-align: middle;
  background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--line); color: transparent; font-size: 0;
}
/* 미납(입력 가능): 흰 바탕 + 테두리, 마우스를 올리면 강조 */
.cell:hover { background: var(--sky); box-shadow: inset 0 0 0 1.5px var(--kit); }
.cell.paid { background: var(--kit); box-shadow: none; }
.cell.paid:hover { background: var(--kit-deep); }
.cell.paid::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) translate(1px, -1px); }
.cell.due { background: var(--red-tint); box-shadow: inset 0 0 0 1.5px var(--red); }
.cell.due:hover { background: #f2dada; }
/* 가입 전(입력 불가): 회색 채움, 테두리 없음 */
.cell.na { display: inline-block; vertical-align: middle; background: var(--muted-bg); box-shadow: none; cursor: not-allowed; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin: 12px 2px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 5px; display: inline-block; background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--line); }
.legend i.paid { background: var(--kit); }
.legend i.due { background: var(--red-tint); box-shadow: inset 0 0 0 1.5px var(--red); }
.legend i.paid { box-shadow: none; }
.legend i.na { background: var(--muted-bg); box-shadow: none; }

/* ── 장부 ────────────────────────────── */
.month-switch { display: inline-flex; align-items: center; gap: 2px; background: var(--sheet); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.month-switch b { font-family: var(--num); font-size: 18px; min-width: 70px; text-align: center; }
.month-switch .icon-btn { width: 34px; height: 34px; color: var(--muted); }
.month-switch .icon-btn:hover { background: var(--paper); }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-lg); }
.totals > div { padding: 14px 16px; }
.totals > div + div { border-left: 1px solid var(--line); }
.totals span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.totals b { font-family: var(--num); font-size: 24px; font-weight: 700; letter-spacing: 0; }
.totals .in b { color: var(--green); }
.totals .out b { color: var(--red); }

.tx { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.tx:last-child { border-bottom: 0; }
.tx-day { flex: none; width: 40px; text-align: center; font-family: var(--num); font-size: 20px; font-weight: 700; color: var(--muted); line-height: 1; }
.tx-day small { display: block; font-family: "Pretendard Variable", sans-serif; font-size: 11px; font-weight: 600; }
.tx-body { flex: 1; min-width: 0; }
.tx-body strong { font-weight: 700; }
.tx-body .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-family: var(--num); font-size: 20px; font-weight: 700; letter-spacing: 0; }
.tx-amt.in { color: var(--green); }
.tx-amt.out { color: var(--ink); }

/* ── 다이얼로그 (모바일: 바텀시트) ────── */
dialog {
  border: 0; padding: 0; color: var(--ink);
  width: min(520px, 100vw); max-width: 100vw; border-radius: 22px;
  box-shadow: 0 20px 60px rgba(31, 41, 55, .25);
}
dialog::backdrop { background: rgba(31, 41, 55, .45); }
dialog .dlg-head { padding: 22px 22px 6px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
dialog .dlg-body { padding: 14px 22px 18px; max-height: 66vh; overflow-y: auto; }
dialog .dlg-foot { padding: 12px 22px 22px; display: flex; gap: 8px; }
dialog .dlg-foot button[value="ok"] { flex: 1; }
@media (max-width: 600px) {
  dialog { margin: auto 0 0; width: 100vw; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  dialog[open] { animation: sheet-up .22s ease-out; }
  .form-grid { grid-template-columns: 1fr; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 10px 12px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

/* ── 토스트 ──────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px); max-width: calc(100vw - 32px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; z-index: 100;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red); }

/* ── 로그인 ──────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--sky); position: relative; overflow: hidden; isolation: isolate; }
.login-wrap::before { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; border-radius: 50%; border: 2px solid rgba(50, 111, 209, .14); top: 50%; left: 50%; transform: translate(-50%, -50%); }
.login-wrap::after { content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 50%; height: 2px; background: rgba(50, 111, 209, .14); }
.login { width: min(360px, 100%); background: var(--sheet); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(50, 111, 209, .12); border-radius: 24px; padding: 28px 24px 24px; }
.login .ball { width: 44px; height: 44px; margin-bottom: 14px; }
.login h1 { font-size: 22px; font-weight: 800; }
.login p { margin: 4px 0 20px; color: var(--muted); }

@media (max-width: 560px) {
  .hide-sm { display: none; }
  .page-head h2 { font-size: 22px; }
  .totals b { font-size: 21px; }
  .totals > div { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── 회원 셀프 출석 페이지 ───────────── */
.check-hero { background: var(--board); color: #fff; padding: 22px 20px 26px; position: relative; overflow: hidden; isolation: isolate; }
.check-hero::before { content: ""; position: absolute; z-index: -1; width: 260px; height: 260px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .08); right: -90px; bottom: -150px; }
.check-hero .club { font-size: 14px; font-weight: 700; color: var(--lime); }
.check-hero h1 { font-size: 26px; font-weight: 800; margin-top: 6px; }
.check-hero .where { color: var(--board-sub); margin-top: 2px; }
.check-hero .tally { margin-top: 16px; }
.check-hero .tally div { color: var(--board-sub); }
.check-hero .tally b { color: #fff; }
.check-main { max-width: 560px; margin: -12px auto 0; padding: 0 14px 40px; position: relative; }
.closed-note { background: var(--red-tint); color: var(--red); font-weight: 700; border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px; }
.att-list li.me { background: var(--sky); margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.search { margin: 12px 0 2px; }

/* ── 설정: 등급별 회비 ───────────────── */
.field-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.grade-fees { border: 1px solid var(--line); border-radius: var(--r-md); }
.grade-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.grade-row + .grade-row { border-top: 1px solid var(--line); }
.grade-row strong { width: 52px; flex: none; }
.grade-row .fee { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.grade-row .fee input { text-align: right; height: 40px; }
.grade-row .fee span { color: var(--muted); font-size: 14px; }
.grade-row .check { flex: none; font-size: 13.5px; }

/* ── 회원 본인 회비 조회 (me.html) ───── */
.me-status { border-radius: var(--r-md); padding: 14px 16px; }
.me-status b { display: block; font-size: 17px; font-weight: 800; }
.me-status span { font-size: 14px; }
.me-status.warn { background: var(--red-tint); color: var(--red); }
.me-status.ok { background: var(--green-tint); color: var(--green); }
.me-this { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.me-bank { display: flex; align-items: center; gap: 10px; background: var(--sky); border-radius: var(--r-md); padding: 12px 14px; }
.me-bank > div { flex: 1; min-width: 0; }
.me-bank span { display: block; font-size: 12.5px; }
.me-bank b { display: block; word-break: break-all; }
.me-bank button { background: var(--sheet); }
.me-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.me-month { border-radius: var(--r-md); padding: 10px 6px; text-align: center; background: var(--muted-bg); color: var(--disabled); }
.me-month b { display: block; font-family: var(--num); font-size: 20px; line-height: 1.1; }
.me-month span { font-size: 12px; font-weight: 700; }
.me-month.paid { background: var(--kit); color: #fff; }
.me-month.unpaid { background: var(--red-tint); color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }
.me-month.due { background: var(--sheet); color: var(--kit); box-shadow: inset 0 0 0 1.5px var(--kit); }
.me-month.upcoming { background: var(--sheet); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* 회원 수정 창: 회비 조회 링크 */
.member-link { background: var(--sky); border-radius: var(--r-md); padding: 12px 14px; }
.member-link .row { margin-top: 8px; }

/* ── 장부: 수입·지출 / 찬조 전환 ─────── */
.seg-tabs { display: flex; background: var(--muted-bg); border-radius: var(--r-md); padding: 4px; margin: -4px 0 14px; }
.seg-tabs a { flex: 1; text-align: center; padding: 8px 0; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 14.5px; }
.seg-tabs a.on { background: var(--sheet); color: var(--kit); box-shadow: 0 0 0 1px var(--line); }
.totals.two { grid-template-columns: repeat(2, 1fr); }
.badge.goods { white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }

/* 입력창 안의 2지선다 (회원/외부, 현금/물품) */
.seg-radio { display: flex; background: var(--muted-bg); border-radius: var(--r-md); padding: 4px; }
.seg-radio label { position: relative; flex: 1; text-align: center; padding: 8px 0; border-radius: 9px; color: var(--muted); font-weight: 700; cursor: pointer; }
.seg-radio input { position: absolute; inset: 0; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.seg-radio label:has(input:checked) { background: var(--sheet); color: var(--kit); box-shadow: 0 0 0 1px var(--line); }
.seg-radio label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--kit) 45%, transparent); }
div.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

/* ── 선택 상자(select) ────────────────── */
/* 닫힌 상태: 모든 브라우저 공통. 기본 화살표 대신 앱 스타일 화살표 */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 42px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b8c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
select:hover { border-color: #c9d6ea; }

/* 펼친 목록: 커스터마이즈 가능한 select 지원 브라우저(크롬·엣지 135+)에서만 적용.
   지원하지 않는 브라우저(iOS 사파리 등)는 기기 기본 선택창을 그대로 쓴다. */
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: flex; align-items: center; }
  select::picker-icon { display: none; }
  select:open { border-color: var(--kit); box-shadow: 0 0 0 3px var(--sky); }
  ::picker(select) {
    border: 1px solid var(--line); border-radius: 14px; padding: 6px; margin-top: 6px;
    background: var(--sheet); box-shadow: 0 14px 36px rgba(26, 36, 64, .16);
    max-height: min(320px, 50vh); overflow-y: auto;
  }
  select option {
    display: flex; align-items: center; gap: 8px;
    min-height: 42px; padding: 0 12px; border-radius: 9px;
    font-size: 15px; color: var(--ink); cursor: pointer;
  }
  select option:hover, select option:focus-visible { background: var(--muted-bg); outline: none; }
  select option:checked { background: var(--sky); color: var(--kit); font-weight: 700; }
  select option::checkmark { order: 1; margin-left: auto; color: var(--kit); }
  select option:disabled { color: var(--disabled); }
}

/* 숫자 입력칸의 기본 증감 화살표 숨김 (금액은 키보드로 입력) */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* 링크(a)를 버튼처럼: 문자앱 열기 등 */
a.btn { text-decoration: none; color: var(--kit); }
a.btn.primary { background: var(--kit); color: #fff; }
a.btn.primary:hover { background: var(--kit-deep); }
.btn.wide { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* 홈 전광판: 회원 통계 (3칸) */
.sb-note { font-size: 13.5px; color: var(--muted); margin: -12px 0 16px; }
.sb-split.three { grid-template-columns: repeat(3, 1fr); }

/* ── 장부: 잔액 카드 / 통장식 목록 ───── */
.bal-card { background: var(--sky); border-radius: 18px; padding: 16px 18px 14px; }
.bal-label { font-size: 13.5px; font-weight: 700; color: var(--kit); }
.bal-figure { font-family: var(--num); font-weight: 700; font-size: 40px; line-height: 1.05; margin-top: 2px; }
.bal-figure small { font-family: "Pretendard Variable", sans-serif; font-size: 17px; margin-left: 3px; }
.bal-figure.neg { color: var(--red); }
.bal-note { font-size: 13px; color: var(--muted); margin-top: 6px; }
.bal-split { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(50, 111, 209, .18); }
.bal-split > div + div { border-left: 1px solid rgba(50, 111, 209, .18); padding-left: 12px; }
.bal-split span { display: block; font-size: 12.5px; color: var(--muted); }
.bal-split b { font-family: var(--num); font-size: 21px; font-weight: 700; letter-spacing: 0; }
.bal-split b.in { color: var(--green); }
.bal-split b.out { color: var(--red); }

.ledger-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.quick .muted { margin-right: 2px; }
.quick button { border-radius: 999px; }

.tx-right { text-align: right; flex: none; }
.tx-bal { font-family: var(--num); font-size: 13px; color: var(--disabled); letter-spacing: 0; }
.dues-row .badge { vertical-align: 1px; }
.dues-row[aria-expanded="true"] { border-bottom-style: dashed; }
.dues-detail { padding: 2px 0 8px 52px; border-bottom: 1px solid var(--line); }
.dues-item { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 5px 0; }
.dues-item > span:last-child { font-family: var(--num); font-size: 16px; color: var(--green); }

/* ── 영수증 인식 (지출 입력창 상단) ─────── */
.ocr-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px; margin-bottom: 16px;
  border: 1px dashed #bcd0ef; border-radius: var(--r-md); background: var(--muted-bg);
}
.ocr-bar button { background: #fff; border: 1px solid var(--line); }
.ocr-bar button:hover { background: var(--sky); }
.ocr-bar .ocr-status { flex-basis: 100%; margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.ocr-bar .ocr-status.ok { color: var(--green); font-weight: 600; }
.ocr-bar .ocr-status.err { color: var(--red); font-weight: 600; }
.ocr-bar.busy button { pointer-events: none; opacity: .5; }
.ocr-bar.busy .ocr-status::before {
  content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid var(--kit); border-right-color: transparent; border-radius: 50%;
  animation: ocr-spin .8s linear infinite;
}
@keyframes ocr-spin { to { transform: rotate(360deg); } }
/* PC(마우스)에서는 카메라 버튼 대신 '사진 선택'만 */
@media (hover: hover) and (pointer: fine) { .ocr-bar .ocr-cam { display: none; } }
.ocr-filled { animation: ocr-flash 1.6s ease-out; }
@keyframes ocr-flash { 0%, 40% { background: #e6f4ee; border-color: var(--green); } 100% { background: #fff; } }
@media (prefers-reduced-motion: reduce) { .ocr-filled, .ocr-bar.busy .ocr-status::before { animation: none; } }

/* ── 메인: 다가오는 생일 ─────────────── */
.birthday-list { list-style: none; margin: 0; padding: 4px 16px; }
.birthday-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.birthday-list li + li { border-top: 1px solid var(--line); }
.birthday-list .bd-date { width: 44px; flex-shrink: 0; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.15; }
.birthday-list .bd-date b { display: block; font-family: var(--num); font-size: 22px; color: var(--ink); }
.birthday-list li.today .bd-date b { color: var(--lime-ink); }
.badge.lime { background: var(--lime-tint); color: var(--lime-ink); }
.birthday-list .bd-name { flex: 1; min-width: 0; }
.birthday-list .bd-name strong { font-size: 15.5px; }
.birthday-list .bd-name small { display: block; color: var(--muted); font-size: 12.5px; }
.birthday-list .bd-dday { font-family: var(--num); font-weight: 700; font-size: 16px; color: var(--muted); }
/* 회원 명단: 나이대 필터는 상태 필터보다 한 단계 작게 */
.chips.age { margin-top: -6px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; } /* 7칸을 화면 폭에 맞춰 한 줄로 */
.chips.age button { height: 30px; padding: 0; min-width: 0; font-size: 13px; letter-spacing: -0.02em; }
@media (min-width: 601px) { .chips.age { display: flex; } .chips.age button { padding: 0 12px; } }
