/* ============================================================
   교적수첩 — 공통 스타일 (UI 시안 기준: 진남색 좌측 메뉴 + 흰 상단바 + 청록/블루 포인트)
   접근성: 큰 글자 · 44px 이상 터치 영역 · 높은 대비 · 키보드 초점 표시 · 글자 크기 3단계
   ============================================================ */
:root {
  --navy: #1B3556;
  --navy-2: #264570;
  --nav-active: #1E78C2;
  --teal: #0C7790;
  --teal-2: #0A6485;
  --blue: #1565A8;
  --green: #0E7C66;
  --red: #C62828;
  --bg: #F3F6F9;
  --card: #FFFFFF;
  --line: #D9E0E7;
  --text: #1D2733;
  --muted: #5B6672;
  --soft-blue: #E6F1FB;
  --soft-teal: #DDF3F6;
  --soft-green: #E3F5EA;
  --soft-pink: #FDE9EF;
  --soft-orange: #FFF0E0;
  --soft-purple: #ECE9FB;
  --radius: 10px;
  --side-w: 12.5rem;
}
html { font-size: 16px; }
html.fs-2 { font-size: 18px; }
html.fs-3 { font-size: 20px; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard", "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 1rem; line-height: 1.55; word-break: keep-all;
}
a { color: var(--blue); }
h1 { font-size: 1.45rem; margin: 0; line-height: 1.3; color: #14284A; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; color: #14284A; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #FFB000; outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
.skip-link { position: absolute; left: 8px; top: -60px; background: #000; color: #fff; padding: .6rem 1rem; z-index: 100; border-radius: 6px; }
.skip-link:focus { top: 8px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .45rem 1rem; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.btn svg { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }
.btn-primary { background: linear-gradient(180deg, var(--teal), var(--teal-2)); color: #fff; }
.btn-primary:hover { background: var(--teal-2); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #0B6552; }
.btn-blue { background: linear-gradient(180deg, #1A74BE, var(--blue)); color: #fff; }
.btn-blue:hover { background: #104E86; }
.btn-line { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-line:hover { background: var(--soft-blue); }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: #EDF1F5; }
.btn-gray { background: #7C8793; color: #fff; }
.btn-gray:hover { background: #626C77; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #A11F1F; }
.btn-danger-line { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger-line:hover { background: #FCEEEE; }
.btn-lg { min-height: 50px; font-size: 1.05rem; padding: .55rem 1.5rem; }
.btn-sm { min-height: 40px; padding: .3rem .8rem; font-size: .92rem; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- 전체 틀 ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--navy), #223C60 60%, #2A4468); color: #fff;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40;
}
.side-brand { display: flex; align-items: center; gap: .55rem; height: 4.1rem; padding: 0 1rem; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.12rem; }
.side-brand svg { width: 28px; height: 28px; fill: #fff; flex: none; }
.side-nav { display: flex; flex-direction: column; padding-bottom: 1.5rem; }
.side-item {
  display: flex; align-items: center; gap: .75rem; min-height: 3.1rem; padding: .4rem 1rem; color: #E6EDF6;
  text-decoration: none; font-weight: 600; border-left: 4px solid transparent;
}
.side-item svg { width: 22px; height: 22px; fill: currentColor; flex: none; opacity: .92; }
.side-item:hover { background: rgba(255,255,255,.08); }
.side-item.active { background: var(--nav-active); color: #fff; border-left-color: #8FD0FF; }
.side-item.disabled { color: #A9B8CC; cursor: default; }
.side-item.disabled:hover { background: transparent; }
.side-item em { margin-left: auto; font-style: normal; font-size: .72rem; background: rgba(255,255,255,.16); border-radius: 999px; padding: .05rem .5rem; color: #E6EDF6; }
.side-sub { background: rgba(0,0,0,.18); padding: .3rem 0; }
.side-sub a { display: flex; align-items: center; min-height: 2.6rem; padding: .3rem 1rem .3rem 3.4rem; color: #D5E0EE; text-decoration: none; font-size: .95rem; }
.side-sub a:hover { background: rgba(255,255,255,.08); }
.side-sub a.active { color: #fff; font-weight: 800; background: rgba(255,255,255,.12); }
.scrim { display: none; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .9rem; padding: .55rem 1.5rem; min-height: 4.1rem;
}
.menu-btn, .m-brand { display: none; }
.gsearch { flex: 1; display: flex; gap: .5rem; max-width: 36rem; position: relative; }
.gsearch input { flex: 1; min-width: 0; padding-left: 2.6rem; border-radius: 10px; }
.gsearch .ico { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: #4C5866; pointer-events: none; }
.top-tools { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.fs-group { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.fs-btn { min-width: 40px; min-height: 44px; border: 0; background: #fff; cursor: pointer; font-family: inherit; font-size: 14px; color: var(--text); padding: 0; }
.fs-btn-2 { font-size: 17px; } .fs-btn-3 { font-size: 21px; font-weight: 700; }
.fs-btn + .fs-btn { border-left: 1px solid var(--line); }
.fs-btn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.bell { position: relative; display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 50%; color: var(--text); }
.bell:hover { background: #EDF1F5; }
.bell svg { width: 24px; height: 24px; fill: currentColor; }
.bell b { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: .75rem; line-height: 20px; text-align: center; }
.acct { position: relative; }
.acct summary { list-style: none; display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .4rem; cursor: pointer; border-radius: 8px; font-weight: 700; }
.acct summary::-webkit-details-marker { display: none; }
.acct summary:hover { background: #EDF1F5; }
.acct summary::after { content: "▾"; color: var(--muted); font-size: .8rem; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: var(--soft-blue); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 15rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20,40,74,.16); padding: .8rem; z-index: 50; }
.acct-menu .fs-group { margin: .3rem 0 .8rem; }
.acct-menu form { margin: 0; }
.acct-menu .btn { width: 100%; }
.acct-menu .who { color: var(--muted); font-size: .9rem; }
.only-m { display: none !important; }

.content { padding: 1.25rem 1.5rem 2.5rem; max-width: 80rem; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .count { color: var(--muted); font-weight: 600; font-size: 1rem; margin-left: .35rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem 1.25rem; margin-bottom: 1rem; }
.card-flush { padding: 0; overflow: hidden; }
.back-link { display: inline-block; margin-bottom: .6rem; }

/* ---------- 알림 ---------- */
.alert { padding: .85rem 1.1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; font-weight: 600; }
.alert-ok { background: #E8F5EC; color: #1E6B3A; border-color: #9CCFAE; }
.alert-error { background: #FCEEED; color: #A3231C; border-color: #E6A19C; }
.alert-info { background: #FFF6DD; color: #6E4A00; border-color: #E5C97A; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; font-weight: 400; }
.alert a { color: inherit; }

/* ---------- 입력 ---------- */
label, .label { display: block; font-weight: 700; margin-bottom: .3rem; }
.req { color: var(--red); margin-left: .15rem; }
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=date], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: .5rem .75rem; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #8A939D; border-radius: 8px;
}
select { padding-right: 2rem; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 3px solid #FFB000; outline-offset: 1px; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); border-width: 2px; }
input[readonly] { background: #F0F3F6; }
.hint { color: var(--muted); font-size: .9rem; margin: .25rem 0 0; }
.field-error { color: var(--red); font-weight: 700; font-size: .95rem; margin: .25rem 0 0; }
.field { margin-bottom: 1rem; }
.field-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .5rem 1rem; align-items: center; margin-bottom: .9rem; }
.field-row > label, .field-row > .label { margin: 0; text-align: left; }
.field-row .hint { grid-column: 2; margin-top: -.4rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.25rem; }
.span2 { grid-column: span 2; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: 1.1rem; font-weight: 800; padding: 0; margin-bottom: .8rem; }
.choice-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.choice { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .35rem .85rem; border: 1px solid #8A939D; border-radius: 8px; background: #fff; font-weight: 500; margin: 0; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--teal); flex: none; }
.choice:has(input:checked) { border-color: var(--teal); background: var(--soft-teal); }
.btn-row { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }

/* ---------- 필터 / 표 ---------- */
.filterbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filterbar .field { margin: 0; min-width: 9rem; flex: 1 1 9rem; max-width: 14rem; }
.filterbar label { font-size: .88rem; color: var(--muted); }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: -.4rem 0 1rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; background: var(--soft-teal); color: #08586C; border-radius: 999px; padding: .15rem .8rem; font-weight: 600; font-size: .92rem; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.dtable { width: 100%; border-collapse: collapse; min-width: 44rem; }
.dtable th, .dtable td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid #E8ECF0; vertical-align: middle; white-space: nowrap; }
.dtable thead th { background: #F0F4F8; font-size: .92rem; position: sticky; top: 0; }
.dtable thead th a { color: var(--text); text-decoration: none; }
.dtable thead th a:hover { text-decoration: underline; }
.dtable tbody tr:hover { background: #F6FAFD; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable td.name a { font-weight: 800; color: #14284A; text-decoration: none; display: inline-block; padding: .25rem 0; }
.dtable td.name a:hover { text-decoration: underline; }
.dtable .num { text-align: right; }
.dtable .c { text-align: center; }
.dtable input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--teal); }
.dtable .ck { width: 3rem; text-align: center; }
.dtable td.wrap { white-space: normal; min-width: 10rem; }
.tel { white-space: nowrap; text-decoration: none; color: inherit; }
.photo { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #E6EBF1; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #4C5866; vertical-align: middle; }
.photo.round { border-radius: 50%; }
.ph { background: var(--soft-blue); color: var(--navy); }

.pill { display: inline-block; padding: .12rem .8rem; border-radius: 999px; font-size: .88rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: #DCEEFF; color: #0B4F8A; }
.pill-new { background: #D6F2F6; color: #07586B; }
.pill-off { background: #ECEEF1; color: #444C55; }
.pill-purple { background: var(--soft-purple); color: #3F3A93; }
.pill-sky { background: #D9F0FB; color: #0B5878; }
.pill-green { background: #DDF4E6; color: #1B6A3C; }
.pill-red { background: #FFE2E0; color: #A3231C; }
.pill-pink { background: #FBDDF0; color: #8A1B66; }

.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: .9rem; }
.pages { display: flex; gap: .3rem; flex-wrap: wrap; }
.pages a, .pages span { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 .6rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--text); font-weight: 700; }
.pages span.cur { background: var(--teal); border-color: var(--teal); color: #fff; }
.pages span.dis { color: #9AA1A9; background: #F2F4F6; }
.size-form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.size-form select { width: auto; }
.empty { text-align: center; padding: 2.5rem 1rem; }
.empty p { font-size: 1.05rem; }

.sel-bar { display: none; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--soft-teal); border: 1px solid #A9DCE6; border-radius: 8px; padding: .5rem .9rem; margin-bottom: .7rem; font-weight: 700; }
.sel-bar.on { display: flex; }

.colset { margin-bottom: 1rem; }
.colset summary { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .9rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 700; list-style: none; }
.colset summary::-webkit-details-marker { display: none; }
.colset .colset-box { display: flex; flex-wrap: wrap; gap: .4rem; padding: .7rem; margin-top: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table.dtable[data-hide~="photo"] .col-photo, table.dtable[data-hide~="gender"] .col-gender, table.dtable[data-hide~="age"] .col-age,
table.dtable[data-hide~="mobile"] .col-mobile, table.dtable[data-hide~="dio"] .col-dio, table.dtable[data-hide~="dis"] .col-dis,
table.dtable[data-hide~="pos"] .col-pos, table.dtable[data-hide~="status"] .col-status, table.dtable[data-hide~="reg"] .col-reg,
table.dtable[data-hide~="no"] .col-no { display: none; }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; border-bottom: 2px solid var(--navy); margin-bottom: 1rem; }
.tabs a, .tabs span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.1rem; border-radius: 8px 8px 0 0; background: #fff; border: 1px solid var(--line); border-bottom: 0; color: var(--text); text-decoration: none; font-weight: 700; }
.tabs a:hover { background: #EDF1F5; }
.tabs a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tabs span.off { color: #7A8591; background: #F0F3F6; font-weight: 500; }
.tabs span.off small { margin-left: .35rem; font-size: .72rem; }
html:not(.js) .tabs[role=tablist] { display: none; }
.tabs-teal a.on { background: var(--teal); border-color: var(--teal); }
.tabs-teal { border-bottom-color: var(--teal); }

/* ---------- 대시보드 ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; margin-bottom: 1rem; }
.hero { position: relative; min-height: 14rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #CFE5F7; }
.hero svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-text { position: relative; padding: 3.2rem 2rem 1rem 46%; color: #1A2C48; }
.hero-text .l1 { font-size: 1.1rem; font-weight: 600; }
.hero-text .l2 { font-size: 1.7rem; font-weight: 800; line-height: 1.3; margin-bottom: .5rem; }
.hero-text .verse { font-size: .9rem; color: #31455F; }
.today { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.today .date { padding: .9rem 1.1rem .7rem; font-weight: 800; font-size: 1.1rem; color: #14284A; }
.today .head { background: var(--teal); color: #fff; text-align: center; font-weight: 800; padding: .5rem; margin: 0 .8rem; border-radius: 6px; }
.today ul { list-style: none; margin: 0; padding: .5rem 1.1rem 1rem; }
.today li { display: flex; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid #EEF1F4; }
.today li:last-child { border-bottom: 0; }
.today li b { min-width: 3.6rem; color: #14284A; }
.today .none { padding: .8rem 1.1rem 1rem; color: var(--muted); }
.kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi a { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: var(--radius); text-decoration: none; color: var(--text); border: 1px solid transparent; }
.kpi a:hover { border-color: var(--line); filter: brightness(.98); }
.kpi .ic { width: 3.1rem; height: 3.1rem; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.kpi .ic svg { width: 1.7rem; height: 1.7rem; }
.kpi .k { font-weight: 600; font-size: .95rem; }
.kpi .v { font-size: 1.55rem; font-weight: 800; line-height: 1.2; color: #14284A; }
.kpi-blue { background: var(--soft-blue); } .kpi-blue svg { fill: #2A7DE1; }
.kpi-green { background: var(--soft-green); } .kpi-green svg { fill: #1E9E5F; }
.kpi-pink { background: var(--soft-pink); } .kpi-pink svg { fill: #E4456F; }
.kpi-orange { background: var(--soft-orange); } .kpi-orange svg { fill: #E88B1C; }
.quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .8rem; }
.quick a, .quick span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; min-height: 7.2rem; border-radius: var(--radius); background: #F3F9FD; border: 1px solid #DCEAF5; color: #14284A; font-weight: 700; text-decoration: none; text-align: center; padding: .6rem; }
.quick a:hover { background: #E4F1FA; }
.quick svg { width: 2rem; height: 2rem; fill: var(--blue); }
.quick span { color: #7A8591; background: #F3F5F7; border-color: #E4E8EC; }
.quick span svg { fill: #A5AEB8; }
.quick small { font-weight: 500; font-size: .75rem; }
.cols2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid #E8ECF0; align-items: center; }
.simple-list li:last-child { border-bottom: 0; }
.bar-row { display: grid; grid-template-columns: 8rem 1fr 4rem; gap: .6rem; align-items: center; padding: .3rem 0; }
.bar { height: 14px; background: #E6ECF2; border-radius: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--teal); }
.bar-row .n { text-align: right; font-weight: 800; }

/* ---------- 등록 마법사 ---------- */
.steps { display: flex; justify-content: center; list-style: none; margin: 0 auto 1.4rem; padding: 0; max-width: 40rem; }
.steps li { flex: 1; text-align: center; position: relative; font-weight: 700; color: var(--muted); }
.steps li::before { content: attr(data-n); display: flex; width: 2.4rem; height: 2.4rem; margin: 0 auto .3rem; border-radius: 50%; background: #C5CCD4; color: #fff; align-items: center; justify-content: center; font-size: 1.05rem; position: relative; z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 1.2rem; left: calc(50% + 1.4rem); right: calc(-50% + 1.4rem); height: 2px; background: #C5CCD4; }
.steps li:last-child::after { display: none; }
.steps li.cur { color: #14284A; }
.steps li.cur::before { background: var(--teal); }
.steps li.done::before { background: var(--teal); content: "✓"; }
.steps li.done::after { background: var(--teal); }
html.js .wizard .wpanel { display: none; }
html.js .wizard .wpanel.active { display: block; }
.wpanel > h2 { display: none; }
html:not(.js) .wpanel > h2 { display: block; }
.photo-box { width: 11rem; }
.photo-box .pv { width: 11rem; height: 11rem; border-radius: var(--radius); background: #EEF1F4; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: .6rem; }
.photo-box .pv img { width: 100%; height: 100%; object-fit: cover; }
.photo-box .pv svg { width: 5rem; height: 5rem; fill: #AEB7C1; }
.photo-box .btn { width: 100%; }
.photo-box input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-box .rm { margin-top: .4rem; width: 100%; }
.reg-grid { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; }
.fam-add { border: 1px dashed #9AA6B2; border-radius: 8px; padding: .9rem; margin-bottom: 1rem; }
.fam-add .row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.fam-add .row > div { flex: 1 1 12rem; }
.sugg { list-style: none; margin: .4rem 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-height: 14rem; overflow-y: auto; }
.sugg:empty { display: none; }
.sugg li button { width: 100%; text-align: left; min-height: 44px; padding: .4rem .8rem; border: 0; border-bottom: 1px solid #EEF1F4; background: #fff; font: inherit; cursor: pointer; }
.sugg li button:hover, .sugg li button:focus { background: var(--soft-blue); }
.fam-rows { list-style: none; margin: 0; padding: 0; }
.fam-rows li { display: flex; align-items: center; gap: .8rem; padding: .5rem .2rem; border-bottom: 1px solid #E8ECF0; flex-wrap: wrap; }
.fam-rows li .nm { font-weight: 800; flex: 1 1 8rem; }
.wnav { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }

/* ---------- 상세 ---------- */
.pcard { display: grid; grid-template-columns: auto minmax(0, 1fr) 19rem; gap: 1.2rem; align-items: start; }
.pcard .big { width: 9.5rem; height: 9.5rem; border-radius: var(--radius); object-fit: cover; background: #E6EBF1; display: flex; align-items: center; justify-content: center; font-size: 3rem; font-weight: 800; color: var(--navy); }
.pcard h1 { font-size: 1.6rem; }
.pcard h1 small { font-size: 1.05rem; color: var(--muted); font-weight: 600; margin-left: .4rem; }
.pc-lines { list-style: none; margin: .5rem 0 .8rem; padding: 0; }
.pc-lines li { display: flex; gap: .55rem; align-items: baseline; padding: .12rem 0; }
.pc-lines b { color: var(--muted); font-weight: 600; min-width: 3.4rem; }
.pc-info { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pc-info div { display: grid; grid-template-columns: 6rem 1fr; border-bottom: 1px solid #E8ECF0; }
.pc-info div:last-child { border-bottom: 0; }
.pc-info dt, .pc-info dd { margin: 0; padding: .5rem .8rem; }
.pc-info dt { background: #F3F6F9; color: var(--muted); font-weight: 600; }
dl.info { display: grid; grid-template-columns: 8rem 1fr; gap: .6rem 1rem; margin: 0; }
dl.info dt { color: var(--muted); font-weight: 600; }
dl.info dd { margin: 0; overflow-wrap: anywhere; }
.memo { white-space: pre-wrap; }
.fam-grid { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1.2rem; }
.ftable { width: 100%; border-collapse: collapse; }
.ftable th, .ftable td { padding: .55rem .6rem; border-bottom: 1px solid #E8ECF0; text-align: left; }
.ftable th { background: #F3F6F9; font-size: .9rem; }
.ftable td.nm a { font-weight: 800; text-decoration: none; color: #14284A; }
.ftable .rm-form { margin: 0; display: inline; }
.tree { display: flex; flex-direction: column; align-items: center; gap: 0; padding: .5rem 0; }
.t-row { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; position: relative; }
.t-couple { align-items: center; gap: 0; flex-wrap: nowrap; }
.t-link { width: 1.6rem; height: 2px; background: #C4506B; }
.t-drop { width: 2px; height: 1.2rem; background: #5B6672; }
.t-kids { gap: 1rem; padding-top: 1rem; border-top: 2px solid #5B6672; margin-top: 0; }
.t-kids .node { position: relative; }
.t-kids .node::before { content: ""; position: absolute; top: -1.05rem; left: 50%; width: 2px; height: 1rem; background: #5B6672; }
.t-others { margin-top: 1.2rem; }
.node { display: flex; align-items: center; gap: .6rem; min-width: 9.5rem; padding: .5rem .8rem; border-radius: 10px; border: 1px solid #B8D8F0; background: #EAF5FF; text-decoration: none; color: var(--text); }
.node .photo { width: 40px; height: 40px; flex: none; }
.node .nn { font-weight: 800; color: #14284A; line-height: 1.25; }
.node .ns { font-size: .85rem; color: var(--muted); }
.node-self { background: #E3F0FF; border: 2px solid #2A7DE1; }
.node-spouse { background: #FFEDF1; border-color: #F0B8C6; }
.node-other { background: #F4F6F8; border-color: #D3DAE1; }
.danger-zone { margin-top: 1.2rem; text-align: right; }

/* ---------- 조직 / 직분 ---------- */
.org-layout { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.tree-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tree-panel h2 { padding: .75rem 1rem; background: #F0F4F8; margin: 0; font-size: 1rem; border-bottom: 1px solid var(--line); }
.otree, .otree ul { list-style: none; margin: 0; padding: 0; }
.otree { padding: .4rem .5rem 1rem; }
.otree ul { padding-left: 1.3rem; }
.otree details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .3rem; min-height: 44px; padding-right: .3rem; }
.otree details > summary::-webkit-details-marker { display: none; }
.otree details > summary::before { content: "›"; display: inline-block; width: 1.2rem; text-align: center; font-weight: 800; color: var(--muted); transition: transform .1s; }
.otree details[open] > summary::before { transform: rotate(90deg); }
.otree a.on { background: var(--soft-blue); font-weight: 800; }
.otree a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .5rem; border-radius: 6px; color: var(--text); text-decoration: none; flex: 1; }
.otree a:hover { background: #EDF1F5; }
.otree .leaf { padding-left: 1.2rem; display: flex; }
.otree .cnt { color: var(--muted); font-weight: 600; }
.otree .off { opacity: .55; }
.otree .typ { font-size: .72rem; color: #4C5866; background: #E8EDF2; border-radius: 4px; padding: 0 .35rem; }

/* ---------- 새가족 / 가져오기 ---------- */
.fu-list { list-style: none; margin: 0; padding: 0; }
.fu-list li { border-bottom: 1px solid #E8ECF0; padding: .7rem 0; }
.fu-list li:last-child { border-bottom: 0; }
.fu-list .when { font-weight: 800; color: #14284A; margin-right: .6rem; }
.map-table { width: 100%; border-collapse: collapse; }
.map-table th, .map-table td { padding: .45rem .7rem; border-bottom: 1px solid #E8ECF0; text-align: left; }
.map-table th { background: #F0F4F8; }
.pv-table td.st { font-weight: 800; }
.st-ok { color: #1B6A3C; } .st-dup { color: #8A5A00; } .st-err { color: #A3231C; }
.progress { height: 14px; background: #E6ECF2; border-radius: 7px; overflow: hidden; margin: .6rem 0; }
.progress i { display: block; height: 100%; width: 0; background: var(--teal); transition: width .2s; }

/* ---------- 상세 검색 ---------- */
.search-card { max-width: 52rem; }
.search-card h1 { margin-bottom: 1rem; }
.sgroup { border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.1rem .2rem; margin-bottom: 1rem; }
.sgroup .field-row { grid-template-columns: 6rem minmax(0, 1fr) 6rem minmax(0, 1fr); }
.range { display: flex; align-items: center; gap: .4rem; }
.range span { color: var(--muted); }
.print-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1.5rem; margin-bottom: 1rem; }

/* ---------- 로그인 · 안내 ---------- */
body.plain { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; background: linear-gradient(180deg, #E6F0FA, #F3F6F9); }
.plain-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 2rem; width: 100%; max-width: 27.5rem; box-shadow: 0 8px 28px rgba(20,40,74,.08); }
.plain-box.wide { max-width: 40rem; }
.plain-box h1 { margin-bottom: 1rem; }
.plain-box .btn-primary { width: 100%; }
.login-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.2rem; font-weight: 800; font-size: 1.2rem; color: var(--navy); }
.login-brand svg { width: 34px; height: 34px; fill: var(--navy); }

/* ---------- 인쇄 ---------- */
.psheet { background: #fff; padding: 1rem; }
.psheet h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.psheet table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.psheet th, .psheet td { border: 1px solid #8A939D; padding: .35rem .5rem; text-align: left; }
.psheet th { background: #EEF1F4; }
.psheet thead { display: table-header-group; }
.psheet tr { page-break-inside: avoid; }
.psheet .pimg { width: 36px; height: 44px; object-fit: cover; }
@media print {
  .sidebar, .topbar, .tabbar, .actions, .list-foot, .no-print, .skip-link, .scrim, .alert { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
  .psheet { padding: 0; }
}

/* ============================================================
   모바일 (767px 이하): 메뉴는 서랍 + 하단 탭, 표는 카드, 폼은 1열
   ============================================================ */
.tabbar { display: none; }
@media (max-width: 1100px) {
  .dash-top { grid-template-columns: 1fr; }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcard { grid-template-columns: auto minmax(0, 1fr); }
  .pcard .pc-info { grid-column: 1 / -1; }
  .org-layout, .fam-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .app { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 16rem; height: auto; transform: translateX(-102%); transition: transform .18s; box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,20,40,.5); z-index: 35; }
  .topbar { flex-wrap: wrap; gap: .4rem .5rem; padding: .45rem .75rem; position: static; }
  .menu-btn { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 8px; cursor: pointer; }
  .menu-btn svg { width: 26px; height: 26px; fill: var(--navy); }
  .m-brand { display: block; flex: 1; text-align: center; font-weight: 800; font-size: 1.2rem; color: #1565A8; text-decoration: none; }
  .gsearch { order: 5; flex-basis: 100%; max-width: none; }
  .top-tools { margin-left: 0; }
  .top-tools .fs-group, .acct summary span.nm { display: none; }
  .only-m { display: block !important; }
  .content { padding: .9rem .75rem 6.5rem; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 58px; color: #4C5866; text-decoration: none; font-size: .78rem; font-weight: 700; }
  .tabbar a svg { width: 24px; height: 24px; fill: currentColor; }
  .tabbar a.on { color: var(--blue); }
  .grid2, .grid3, .cols2, .reg-grid, .sgroup .field-row { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .field-row { grid-template-columns: 1fr; }
  .field-row .hint { grid-column: 1; }
  .kpi { gap: .6rem; }
  .kpi a { padding: .7rem .8rem; gap: .6rem; }
  .kpi .ic { width: 2.5rem; height: 2.5rem; }
  .kpi .v { font-size: 1.3rem; }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
  .quick a, .quick span { min-height: 6rem; font-size: .88rem; }
  .hero { min-height: 10rem; }
  .hero-text { padding: 1.6rem 1rem 1rem 38%; }
  .hero-text .l2 { font-size: 1.25rem; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .filterbar .field { max-width: none; flex-basis: 45%; }
  .filterbar .btn { flex: 1 1 100%; }
  .pcard { grid-template-columns: 6.5rem minmax(0, 1fr); gap: .8rem; }
  .pcard .big { width: 6.5rem; height: 6.5rem; font-size: 2.2rem; }
  .pcard .btns { grid-column: 1 / -1; }
  .pc-info div { grid-template-columns: 5rem 1fr; }
  dl.info { grid-template-columns: 6rem 1fr; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .tabs a, .tabs span { flex: none; }
  .form-actions { position: sticky; bottom: 62px; }
  .steps li { font-size: .82rem; }
  .print-opts { grid-template-columns: 1fr; }

  /* 교인 목록: 표 → 카드 (사진 · 이름/직분 · 전화 버튼) */
  .table-wrap.cards { background: transparent; border: 0; overflow: visible; }
  table.cards { min-width: 0; display: block; }
  table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.cards tbody { display: block; }
  table.cards tr { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; grid-template-areas: "ph nm call" "ph tel call" "ph org call"; column-gap: .8rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; margin-bottom: .55rem; }
  table.cards td { display: block; border: 0; padding: 0; white-space: normal; }
  table.cards td.ck, table.cards td.col-gender, table.cards td.col-age, table.cards td.col-pos, table.cards td.col-reg, table.cards td.col-no, table.cards td.col-dis, table.cards td.col-dio, table.cards td.col-status { display: none; }
  table.cards td.col-photo { grid-area: ph; }
  table.cards td.col-photo .photo { width: 3.4rem; height: 3.4rem; }
  table.cards td.name { grid-area: nm; }
  table.cards td.col-mobile { grid-area: tel; color: var(--muted); }
  table.cards td.m-org { grid-area: org; display: block; color: var(--muted); font-size: .92rem; }
  table.cards td.m-call { grid-area: call; display: block; }
  table.cards td.m-call a { display: inline-flex; width: 48px; height: 48px; border-radius: 50%; background: var(--soft-blue); align-items: center; justify-content: center; }
  table.cards td.m-call svg { width: 22px; height: 22px; fill: var(--blue); }
  table.dtable.cards[data-hide] .col-photo, table.dtable.cards[data-hide] .col-mobile { display: block; }
  table.cards .m-only { display: inline; }
  .dtable td.m-org, .dtable td.m-call { display: none; }
  .dtable .m-only { display: none; }
}
@media (min-width: 768px) {
  .m-only, td.m-org, td.m-call { display: none; }
}

/* ============================================================
   추가 화면 (상세 · 새가족 · 조직 · 가져오기 · 인쇄 · 더보기)
   ============================================================ */
.crumbs { margin-bottom: .6rem; color: var(--muted); font-size: .95rem; }
.crumbs a { color: var(--blue); }
.is-disabled { opacity: .55; cursor: not-allowed; }
.pill-gray { background: #ECEEF1; color: #444C55; }
.pill-orange { background: var(--soft-orange); color: #8A4B00; }
.due { color: var(--red); font-weight: 800; }
.acts { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.acts form, .del-form { margin: 0; display: inline; }
.del-form { display: block; text-align: right; margin-top: .6rem; }
.notes { margin: 0 0 1rem; padding-left: 1.2rem; }
.notes li { margin-bottom: .25rem; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: .6rem 0 1.2rem; }
.kpis > div { padding: .9rem 1.1rem; border-radius: var(--radius); }
.kpis .k { font-weight: 600; } .kpis .v { font-size: 1.5rem; font-weight: 800; color: #14284A; }
.kpi-red { background: var(--soft-pink); }
.sample { color: var(--muted); overflow-wrap: anywhere; }
.filterbar { display: flex; gap: .4rem 1rem; flex-wrap: wrap; align-items: flex-end; }
.filterbar .field { margin: 0; flex: 1 1 11rem; }
.filterbar .btn-row { margin: 0; }

/* 교인 상세 머리말 */
.pc-photo { width: 9.5rem; height: 9.5rem; border-radius: var(--radius); background: #E6EBF1; display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 3rem; font-weight: 800; color: var(--navy); }
.pc-photo img { width: 100%; height: 100%; object-fit: cover; }
.pc-main .btn-row { justify-content: flex-start; }
.pc-main h1 small { font-size: 1.05rem; color: var(--muted); font-weight: 600; margin-left: .4rem; }
dl.pc-info { display: grid; grid-template-columns: 6rem minmax(0, 1fr); margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
dl.pc-info dt, dl.pc-info dd { margin: 0; padding: .5rem .8rem; border-bottom: 1px solid #E8ECF0; overflow-wrap: anywhere; }
dl.pc-info dt { background: #F3F6F9; color: var(--muted); font-weight: 600; }
dl.pc-info dt:nth-last-of-type(1), dl.pc-info dd:last-of-type { border-bottom: 0; }
dl.kv { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .6rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); font-weight: 600; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.tabpane h2 { margin-bottom: 1rem; }
.tabpane h3 { margin: 1.2rem 0 .6rem; font-size: 1rem; }

/* 가족관계도 (상세 > 가족) */
.tree .trow { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.tree .trow > li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center; min-width: 9.5rem; padding: .5rem .8rem; border-radius: 10px; border: 1px solid #B8D8F0; background: #EAF5FF; }
.tree .trow > li a { font-weight: 800; color: #14284A; text-decoration: none; }
.tree .trow > li .rel { font-size: .85rem; color: var(--muted); }
.tree .trow > li form { margin: 0; flex-basis: 100%; text-align: center; }
.tree .node.self { background: #E3F0FF; border: 2px solid #2A7DE1; flex-direction: column; gap: .1rem; }
.tree .tline { width: 2px; height: 1.2rem; background: #5B6672; }
.tree .trow.rest { margin-top: 1rem; }

/* 조직 관리 트리 */
.org-layout .otree { padding: 1.15rem 1.25rem; }
.org-layout .otree ul { padding-left: 1.2rem; }
.org-layout .otree > ul.tree-root { padding-left: 0; }
.otree .otype { font-size: .72rem; color: #4C5866; background: #E8EDF2; border-radius: 4px; padding: 0 .35rem; }
.otree .cnt { margin-left: auto; }
.otree a[aria-current] { background: var(--soft-blue); font-weight: 800; }

/* 더보기 · 인쇄 */
.morelist ul { list-style: none; margin: 0; padding: 0; }
.morelist a { display: flex; align-items: center; min-height: 52px; padding: 0 .4rem; border-bottom: 1px solid #E8ECF0; color: var(--text); text-decoration: none; font-weight: 700; }
form.print-opts { display: block; }
.print-title { text-align: center; font-size: 1.4rem; margin-bottom: .2rem; }
.print-meta { text-align: center; }
.print-table th, .print-table td { border: 1px solid #8A939D; padding: .35rem .5rem; }
.print-table thead { display: table-header-group; }
.print-table tr { page-break-inside: avoid; }
@media (max-width: 767px) {
  .kpis { grid-template-columns: 1fr; }
  dl.kv, dl.pc-info { grid-template-columns: 6rem minmax(0, 1fr); }
  .pc-photo { width: 7rem; height: 7rem; }
}
@media print {
  .print-sheet { border: 0; padding: 0; }
  .print-table { font-size: .85rem; }
}

/* 일반 표 → 모바일에서 카드형 (칸 이름은 data-l 로 표시) */
@media (max-width: 767px) {
  table.stack { display: block; min-width: 0; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack tbody { display: block; }
  table.stack tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .8rem; margin-bottom: .6rem; }
  table.stack td { display: flex; gap: .7rem; border: 0; padding: .25rem 0; white-space: normal; overflow-wrap: anywhere; }
  table.stack td::before { content: attr(data-l); flex: 0 0 5.2rem; color: var(--muted); font-weight: 600; }
  table.stack td:empty { display: none; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tabs a, .tabs span { white-space: nowrap; }
}

/* ===== Phase 2 ===== */
.kpis4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpis4 > div { background: #fff; border: 1px solid #DDE3EA; border-left: 4px solid var(--blue, #1E6FD9); border-radius: 8px; padding: .8rem 1rem; }
.kpis4 .kpi-green { border-left-color: #1E9E5A; } .kpis4 .kpi-orange { border-left-color: #E8890C; } .kpis4 .kpi-red { border-left-color: #D93025; }
.kpis4 .k { color: var(--muted, #667); font-size: .88rem; } .kpis4 .v { font-size: 1.5rem; font-weight: 800; }
.bar-row .bl { font-weight: 700; } .bar-row .bar { background: #EEF2F6; border-radius: 6px; height: 14px; overflow: hidden; display: block; }
.bar-row .bar i { display: block; height: 100%; background: #1E6FD9; } .bar-row .bv { text-align: right; font-weight: 800; }
.plain-list { list-style: none; margin: 0 0 .8rem; padding: 0; } .plain-list li { padding: .5rem .2rem; border-bottom: 1px solid #E8ECF0; }
.day-h { margin: 1rem 0 .3rem; font-size: 1rem; color: #26364D; }
.overdue { border-left: 4px solid #D93025; }
td.wrap { white-space: normal; word-break: break-word; max-width: 28rem; }
.acts form { display: inline-block; margin: 0 .2rem .2rem 0; }
.more { margin: .6rem 0; } .more > summary { cursor: pointer; font-weight: 700; padding: .4rem 0; }
.status-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.note-private, .pnote { background: #FFF8E6; border: 1px solid #F0D58A; border-radius: 8px; padding: .8rem 1rem; margin: .6rem 0; white-space: pre-wrap; word-break: break-word; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.att-grid { width: 100%; } .att-grid select { min-width: 6.5rem; }
.cell-P { background: #E3F5EA; } .cell-A { background: #FBE4E1; } .cell-L { background: #FFF1D6; } .cell-O { background: #E4EEFB; } .cell-U { background: #F1F3F5; color: #889; }
@media (max-width: 760px) { .kpis4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bar-row { grid-template-columns: 6rem 1fr 3.5rem; } }
@media print { .no-print, .sidebar, .topbar { display: none !important; } }

/* ===== 입력창 크기 통일 (3차) ===== */
input[type=text], input[type=search], input[type=tel], input[type=email], input[type=date], input[type=time], input[type=password], input[type=number], input[type=url], select {
  height: 46px; min-height: 46px; line-height: 1.3; padding-top: 0; padding-bottom: 0; font-size: 1rem; box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
}
select { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23556' stroke-width='2'/%3E%3C/svg%3E") no-repeat right .8rem center; padding-right: 2.2rem; text-overflow: ellipsis; }
input[type=date], input[type=time] { min-width: 0; }
textarea { box-sizing: border-box; font-size: 1rem; line-height: 1.5; padding-top: .6rem; padding-bottom: .6rem; }
input:disabled, select:disabled, textarea:disabled { background: #EEF1F4; color: #6B7580; }
/* 한 줄 조건 막대: 칸 너비를 같게, 버튼도 같은 높이 */
.filterbar .field { flex: 0 1 13rem; min-width: 10rem; max-width: 13rem; }
.filterbar .btn, .filterbar .btn-row .btn { min-height: 46px; }
.filterbar .field > label.choice { min-height: 46px; display: flex; align-items: center; }
.grid2 > .field, .cols2 > .field { min-width: 0; }
.inline input, .inline select { width: auto; max-width: 14rem; }
.inline .btn { min-height: 46px; }
td input[type=text], td select, td input[type=date] { height: 40px; min-height: 40px; }
.addr-btn { flex: none; min-height: 46px; white-space: nowrap; }
@media (max-width: 760px) { .filterbar .field { flex: 1 1 45%; max-width: none; } input, select, textarea { font-size: 16px; } }

/* ===== 지도 (3차) ===== */
.geomap { width: 100%; height: 480px; border-radius: 10px; border: 1px solid #C9D2DC; background: #EAF0F6; }
.geomap-empty { display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem; color: var(--muted); }
@media (max-width: 760px) { .geomap { height: 55vh; min-height: 300px; } }
.alert { background: #FFF6DD; border: 1px solid #F0D58A; border-radius: 8px; padding: .7rem 1rem; margin: .6rem 0; }
.chartbox { position: relative; height: 260px; margin-bottom: .8rem; }
@media print { .chartbox { height: 220px; } .card { break-inside: avoid; } }

/* ============================================================
   재정관리 (finance/*) — 교적부와 같은 청록·진남색 톤, 큰 글자·넓은 터치 영역
   ============================================================ */
.fin-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.fin-actions .btn { min-height: 48px; }
.fin-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.fin-kpi > a, .fin-kpi > div { display: block; padding: 1rem 1.1rem; border-radius: var(--radius); text-decoration: none; color: var(--text); border: 1px solid transparent; }
.fin-kpi a:hover { border-color: var(--line); filter: brightness(.98); }
.fin-kpi .k { font-weight: 600; font-size: .95rem; display: block; }
.fin-kpi .v { font-size: 1.5rem; font-weight: 800; line-height: 1.25; color: #14284A; display: block; margin-top: .15rem; font-variant-numeric: tabular-nums; }
.fin-kpi .s { font-size: .85rem; color: var(--muted); display: block; }
.fin-in { background: var(--soft-blue); } .fin-out { background: var(--soft-pink); } .fin-bal { background: var(--soft-green); } .fin-wait { background: var(--soft-orange); }
.fin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.fin-cols .card { margin-bottom: 0; }
.fbar { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 8.5rem; gap: .6rem; align-items: center; padding: .28rem 0; font-size: .95rem; }
.fbar .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbar .tr { background: #E8EEF3; border-radius: 6px; height: 1.05rem; position: relative; overflow: hidden; }
.fbar .tr i { display: block; height: 100%; border-radius: 6px; }
.fbar .tr i.in { background: #2A7DE1; } .fbar .tr i.out { background: #E4456F; } .fbar .tr i.teal { background: var(--teal); }
.fbar .bv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.fbar.two .tr { height: .7rem; margin-bottom: 2px; }
.fin-legend { display: flex; gap: 1rem; font-size: .88rem; color: var(--muted); margin-bottom: .4rem; }
.fin-legend b { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }
.dtable td.money, .dtable th.money { text-align: right; font-variant-numeric: tabular-nums; }
.money-in { color: #17609F; font-weight: 700; } .money-out { color: #C2335C; font-weight: 700; } .money-flat { color: var(--text); font-weight: 700; }
.fin-neg { color: var(--red); }
.fin-notice { background: #FFF6DD; border: 1px solid #E5C97A; color: #6E4A00; border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; }
.fin-steps { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.fin-steps li { padding: .25rem .8rem; border-radius: 999px; background: #ECEEF1; color: #444C55; font-weight: 700; font-size: .9rem; }
.fin-steps li.done { background: var(--soft-green); color: #1B6A3C; }
.fin-steps li.now { background: var(--teal); color: #fff; }
.fin-help { background: var(--soft-teal); border-radius: 8px; padding: .7rem 1rem; margin-bottom: 1rem; font-size: .95rem; }
.fin-form .field input[type=text], .fin-form .field input[type=date], .fin-form .field select { max-width: 24rem; }
.fin-form .amt { font-size: 1.3rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; max-width: 14rem; }
.fin-seg { display: flex; gap: .5rem; flex-wrap: wrap; }
.fin-seg label { display: inline-flex; align-items: center; gap: .4rem; min-height: 48px; padding: 0 1.1rem; border: 2px solid var(--line); border-radius: 10px; background: #fff; font-weight: 700; cursor: pointer; }
.fin-seg input { width: 20px; height: 20px; accent-color: var(--teal); }
.fin-seg label:has(input:checked) { border-color: var(--teal); background: var(--soft-teal); }
.fin-grid { width: 100%; border-collapse: collapse; }
.fin-grid th, .fin-grid td { padding: .35rem .4rem; border-bottom: 1px solid #E8ECF0; text-align: left; vertical-align: middle; }
.fin-grid th { background: #F0F4F8; font-size: .9rem; white-space: nowrap; }
.fin-grid input, .fin-grid select { min-width: 0; width: 100%; }
.fin-grid td.n { width: 3rem; color: var(--muted); text-align: center; }
.fin-grid .amt { text-align: right; font-variant-numeric: tabular-nums; }
.fin-sugg { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.14); max-height: 15rem; overflow-y: auto; }
.fin-sugg button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: .55rem .8rem; font: inherit; cursor: pointer; min-height: 44px; }
.fin-sugg button:hover, .fin-sugg button:focus { background: var(--soft-teal); }
.fin-sugg small { color: var(--muted); margin-left: .4rem; }
.fin-donor { position: relative; }
.fin-total { font-size: 1.15rem; font-weight: 800; }
.print-only { display: none; }
@media (max-width: 900px) {
  .fin-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .fin-kpi .v { font-size: 1.25rem; }
  .fin-cols { grid-template-columns: 1fr; }
  .fbar { grid-template-columns: 5.5rem minmax(0, 1fr) 7rem; font-size: .88rem; }
  .fin-grid thead { display: none; }
  .fin-grid, .fin-grid tbody, .fin-grid tr, .fin-grid td { display: block; width: 100%; }
  .fin-grid tr { border: 1px solid var(--line); border-radius: 8px; padding: .5rem; margin-bottom: .6rem; background: #fff; }
  .fin-grid td { border: 0; padding: .2rem 0; }
  .fin-grid td::before { content: attr(data-l); display: block; font-size: .8rem; color: var(--muted); }
  .fin-grid td.n { display: none; }
}
@media print {
  .print-only { display: block; }
  .fin-kpi > a, .fin-kpi > div { border: 1px solid #999; background: #fff !important; }
  .fbar .tr i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.fin-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2rem 1.5rem; margin: 0; }
.fin-dl > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .5rem; padding: .45rem 0; border-bottom: 1px solid #E8ECF0; }
.fin-dl dt { color: var(--muted); font-weight: 600; } .fin-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) { .fin-dl { grid-template-columns: 1fr; } }

/* ===== 운영 콘솔(platform/) ===== */
body.plat { background: var(--bg, #F4F6F9); margin: 0; }
.plat-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .6rem 1.2rem; background: #14284A; color: #fff; }
.plat-brand { color: #fff; font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.plat-nav { display: flex; gap: .3rem; flex: 1; flex-wrap: wrap; }
.plat-nav a { color: #D5DEEE; text-decoration: none; padding: .5rem .8rem; border-radius: 8px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.plat-nav a.on, .plat-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.plat-user { display: flex; align-items: center; gap: .6rem; margin: 0; }
.plat-user .btn { background: #fff; }
.plat-main { max-width: 72rem; margin: 0 auto; padding: 1.2rem 1rem 3rem; }
.plat-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.plat-kpi .card { margin: 0; text-align: left; }
.plat-kpi .v { font-size: 1.6rem; font-weight: 800; color: #14284A; line-height: 1.2; }
.plat-kpi .k { font-weight: 600; color: var(--muted, #5B6675); }
.plat-feat { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid #E8ECF0; }
.plat-feat form { margin: 0; }
@media (max-width: 720px) { .plat-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .plat-bar { padding: .5rem .8rem; } }

/* 영역 전환 (교적관리 ↔ 재정관리) */
.area-switch { display: flex; gap: .25rem; margin: .1rem .8rem .6rem; padding: .25rem; background: rgba(255,255,255,.1); border-radius: 10px; }
.area-switch a { flex: 1; text-align: center; padding: .55rem .4rem; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: #D5DEEE; text-decoration: none; font-weight: 700; font-size: .95rem; }
.area-switch a.on { background: #fff; color: #14284A; }
.area-switch a:not(.on):hover { background: rgba(255,255,255,.14); color: #fff; }
.acct-menu .area-switch { background: #EEF2F7; margin: 0 0 .7rem; }
.acct-menu .area-switch a { color: #3A4658; }
.acct-menu .area-switch a.on { background: #14284A; color: #fff; }
.area-switch span.off { flex: 1; text-align: center; padding: .55rem .4rem; min-height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 8px; color: rgba(213,222,238,.45); font-weight: 700; font-size: .95rem; cursor: not-allowed; }
.acct-menu .area-switch span.off { color: #9AA5B4; }

/* 재정 증빙 첨부 */
.fin-att{display:flex;flex-wrap:wrap;align-items:center;gap:.8rem;padding:.6rem 0;border-bottom:1px solid var(--line,#e5e7eb)}
.fin-att img{max-width:140px;max-height:140px;border:1px solid var(--line,#e5e7eb);border-radius:6px;display:block;background:#fff}
.fin-attform{margin-top:1rem}

/* ===== 입력창 크기 통일 (4차): type 없는 input 안전망 + 모든 입력 종류 동일 규격 ===== */
input:not([type]), input[type=url], input[type=time] {
  width: 100%; padding: 0 .75rem; font: inherit; color: var(--text); background: #fff; border: 1px solid #8A939D; border-radius: 8px;
}
input:not([type]), input[type=text], input[type=search], input[type=tel], input[type=email], input[type=date], input[type=time], input[type=password], input[type=number], input[type=url], select {
  height: 46px; min-height: 46px; box-sizing: border-box; font-size: 1rem; line-height: 1.3;
}
input:not([type]):focus { border-color: var(--teal); outline: 3px solid #FFB000; outline-offset: 1px; }
input:not([type]):disabled { background: #EEF1F4; color: #6B7580; }
input[type=number] { -moz-appearance: textfield; }
.field > input:not([type=checkbox]):not([type=radio]):not([type=file]), .field > select, .field > textarea { width: 100%; }
td input:not([type]) { height: 40px; min-height: 40px; }

/* 대체전표 입력표 */
.fin-jr select, .fin-jr input { min-width: 0; }
.fin-jr td input.amt { text-align: right; font-size: 1.05rem; font-weight: 700; max-width: none; }
.fin-jr tfoot th, .fin-jr tfoot td { font-weight: 800; }
@media (min-width: 761px) { .fin-jr td:first-child select { min-width: 13rem; } .fin-jr td:nth-child(5) input { min-width: 10rem; } }

/* 비품 상태 표시 */
.pill-amber { background: #FFF1CC; color: #7A5200; }
.pill-blue { background: #DDEBFA; color: #17609F; }
