/* 명성교회 톤: 로고 네이비 + 리틀리 라벤더 블루 */
:root {
  --navy: #23408f;
  --navy-deep: #182d66;
  --peri: #9eb6ed;
  --peri-mid: #7a8ebd;
  --peri-soft: #e6ecfb;
  --blue: #4881f7;
  --bg: #eef2fc;
  --card: #ffffff;
  --ink: #1b2238;
  --ink-2: #4a5373;
  --ink-3: #8a93ad;
  --line: #e3e8f4;
  --present: #23408f;
  --absent: #e0566b;
  --absent-soft: #fdecef;
  --warn: #e98a15;
  --warn-soft: #fff3e2;
  --ok: #1f9d6b;
  --ok-soft: #e3f6ee;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(35, 64, 143, .07);
  --tabbar: 64px;
  font-family: SUIT, 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); }
body { min-height: 100dvh; font-size: 15px; line-height: 1.45; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); text-decoration: none; }
.boot { display: grid; place-items: center; height: 100dvh; color: var(--ink-3); }

/* ── 레이아웃 */
.shell { max-width: 720px; margin: 0 auto; padding: 0 16px calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20; margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(238, 242, 252, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; min-width: 0; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.brand small { display: block; font-weight: 600; font-size: 12px; color: var(--ink-3); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.dept-select { max-width: 46%; border: 0; background: var(--card); border-radius: 999px; padding: 7px 12px; font-weight: 700; color: var(--navy); box-shadow: var(--shadow); }

h1.page { font-size: 22px; letter-spacing: -.03em; margin: 8px 2px 12px; }
h2.sec { font-size: 15px; color: var(--ink-2); margin: 22px 4px 8px; display: flex; align-items: center; gap: 6px; }
h2.sec .count { color: var(--ink-3); font-weight: 600; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.empty { text-align: center; color: var(--ink-3); padding: 36px 12px; }

/* ── 탭바 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); display: flex; justify-content: center;
}
.tabbar nav { display: flex; width: 100%; max-width: 720px; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); position: relative; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--navy); }
.tabbar .badge { position: absolute; top: 7px; left: calc(50% + 6px); background: var(--absent); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 5px; }

/* ── 버튼·입력 */
.btn {
  border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700; background: var(--peri-soft); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; min-height: 44px;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.danger { background: var(--absent-soft); color: var(--absent); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; min-height: 34px; border-radius: 11px; font-size: 13.5px; }
.btn:disabled { opacity: .5; }
.icon-btn { border: 0; background: var(--card); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; box-shadow: var(--shadow); color: var(--navy); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 2px 5px; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 12px; outline: none; min-height: 44px;
}
.input:focus { border-color: var(--peri); box-shadow: 0 0 0 3px var(--peri-soft); }
textarea.input { min-height: 84px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--card); box-shadow: var(--shadow); border-radius: 999px; padding: 8px 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; }
.chip small { font-weight: 600; opacity: .7; margin-left: 3px; }
.seg { display: flex; background: var(--peri-soft); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 8px 4px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }

.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 800; border-radius: 7px; padding: 2px 7px; background: var(--peri-soft); color: var(--navy); white-space: nowrap; }
.tag.new { background: #e8f4ff; color: #1a6fd1; }
.tag.high { background: var(--absent-soft); color: var(--absent); }
.tag.mid { background: var(--warn-soft); color: #b5650a; }
.tag.info { background: var(--ok-soft); color: var(--ok); }
.tag.low { background: #eef0f5; color: var(--ink-2); }
.tag.urgent { background: var(--absent); color: #fff; }

/* ── 아바타 */
.avatar { width: 46px; height: 46px; border-radius: 15px; background: var(--peri-soft); color: var(--navy); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; overflow: hidden; position: relative; border: 0; padding: 0; cursor: pointer; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .cam { position: absolute; right: 2px; bottom: 2px; width: 17px; height: 17px; border-radius: 6px; background: var(--navy); color: #fff; display: grid; place-items: center; }
.avatar .cam svg { width: 11px; height: 11px; }
.avatar.lg { width: 112px; height: 112px; border-radius: 32px; font-size: 34px; }
.avatar.lg .cam { width: 30px; height: 30px; border-radius: 10px; right: 4px; bottom: 4px; }
.avatar.lg .cam svg { width: 17px; height: 17px; }

/* ── 출석 체크 */
.datebar { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }
.datebar .date { flex: 1; text-align: center; font-weight: 800; font-size: 17px; background: var(--card); border-radius: 14px; padding: 9px; box-shadow: var(--shadow); position: relative; }
.datebar .date input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.datebar .date small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.summary { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--navy), #3557b7); color: #fff; border-radius: var(--radius); padding: 14px 16px; margin: 4px 0 12px; }
.summary .big { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.summary .big small { font-size: 15px; opacity: .75; font-weight: 700; }
.summary .meta { font-size: 12.5px; opacity: .85; }
.summary .btn { background: rgba(255, 255, 255, .16); color: #fff; }
.progress { height: 6px; background: rgba(255, 255, 255, .22); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .25s; }

.roster { display: grid; gap: 8px; }
.srow { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px; padding: 10px 10px 10px 10px; box-shadow: var(--shadow); border: 2px solid transparent; transition: border-color .15s, background .15s; }
.srow .who { flex: 1; min-width: 0; cursor: pointer; }
.srow .name { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.srow .sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srow.present { border-color: var(--present); background: #f5f8ff; }
.srow.absent .name { color: var(--ink-2); }
.mark { width: 64px; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: #fff; font-weight: 800; color: var(--ink-3); cursor: pointer; flex-shrink: 0; font-size: 14px; }
.srow.present .mark { background: var(--present); border-color: var(--present); color: #fff; }
.srow.absent .mark { border-color: #f3c3cb; color: var(--absent); background: var(--absent-soft); }
.reason-btn { border: 0; background: none; color: var(--absent); font-size: 12px; font-weight: 700; padding: 0; cursor: pointer; }

/* ── 리스트 */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.li:last-child { border-bottom: 0; }
.li .t { font-weight: 800; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.li .d { font-size: 13px; color: var(--ink-2); }
.li .chev { color: var(--ink-3); }
.dots { display: flex; gap: 3px; margin-top: 5px; }
.dots i { width: 9px; height: 9px; border-radius: 3px; background: #f1c9d0; }
.dots i.p { background: var(--navy); }

/* ── 학생 상세 */
.hero { text-align: center; padding: 22px 16px 18px; }
.hero h1 { margin: 12px 0 2px; font-size: 24px; letter-spacing: -.03em; }
.hero .actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 10px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); font-weight: 700; }
.kv dd { margin: 0; word-break: break-all; }
.heat { display: grid; grid-template-columns: repeat(auto-fill, minmax(18px, 1fr)); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 5px; background: #f1c9d0; position: relative; }
.heat i.p { background: var(--navy); }
.heat i.m { background: var(--line); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat3 div { background: var(--peri-soft); border-radius: 14px; padding: 10px; text-align: center; }
.stat3 b { display: block; font-size: 20px; color: var(--navy); }
.stat3 span { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.log { border-left: 3px solid var(--peri); padding: 2px 0 2px 12px; margin: 12px 0; }
.log .h { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.log .c { white-space: pre-wrap; }
.log.answered { border-color: var(--ok); opacity: .7; }
.log.urgent { border-color: var(--absent); }

/* ── 통계 */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 26px; letter-spacing: -.03em; color: var(--navy); }
.kpi span { font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.kpi em { font-style: normal; font-size: 12px; font-weight: 700; margin-left: 4px; }
.kpi em.up { color: var(--ok); }
.kpi em.down { color: var(--absent); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 18px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 30px; background: var(--peri); border-radius: 6px 6px 3px 3px; position: relative; }
.bars .b:last-child i { background: var(--navy); }
.bars .b i::before { content: attr(data-v); position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--ink-2); font-style: normal; }
.bars .b span { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
table.t { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.t th, table.t td { padding: 9px 10px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { background: var(--peri-soft); color: var(--navy); font-weight: 800; position: sticky; top: 0; }
table.t td:first-child, table.t th:first-child { position: sticky; left: 0; background: #fff; text-align: left; font-weight: 800; z-index: 1; }
table.t th:first-child { background: var(--peri-soft); }
table.t tr.total td { font-weight: 800; background: #f6f8fe; color: var(--navy); }

/* ── 시트(모달) */
.sheet-bg { position: fixed; inset: 0; background: rgba(15, 25, 60, .38); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: #c8d1e8; margin: 4px auto 10px; }
.sheet h3 { margin: 4px 2px 14px; font-size: 19px; letter-spacing: -.02em; }
@media (min-width: 640px) { .sheet-bg { align-items: center; } .sheet { border-radius: 24px; } }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
@keyframes fade { from { opacity: 0; } }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ── 로그인 */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, #c9d6f6 0%, var(--bg) 60%); }
.auth .box { width: 100%; max-width: 380px; }
.auth .logo { text-align: center; margin-bottom: 22px; }
.auth .logo img { width: 72px; height: 72px; border-radius: 22px; box-shadow: 0 8px 24px rgba(35, 64, 143, .25); }
.auth .logo h1 { margin: 14px 0 2px; color: var(--navy); font-size: 24px; letter-spacing: -.03em; }
.auth .logo p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.auth .foot { text-align: center; color: var(--ink-3); font-size: 12px; margin-top: 18px; }

.notice { background: var(--warn-soft); color: #8a4b05; border-radius: 14px; padding: 12px 14px; font-size: 13.5px; }
.menu .li svg { width: 20px; height: 20px; color: var(--navy); }
.prayer-card .c { white-space: pre-wrap; margin-top: 6px; }

/* ── 명성교회 로고 · 쉐마 어게인 */
.brand .logo { width: auto; height: 26px; border-radius: 0; }
.brand .dept-name { display: block; font-size: 15px; line-height: 1.1; }
.brand > div { border-left: 1.5px solid var(--line); padding-left: 8px; min-width: 0; }
.shema-card {
  position: relative; overflow: hidden; margin: 6px 0 12px; padding: 16px 18px; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #6f93ea 0%, transparent 55%), linear-gradient(135deg, #1a3478 0%, #23408f 55%, #3a64c8 100%);
  box-shadow: 0 8px 24px rgba(35, 64, 143, .22);
}
.shema-card::after { content: ''; position: absolute; right: -18px; top: -10px; width: 120px; height: 160px; opacity: .13;
  background: linear-gradient(#fff, #fff) 50% 0/14px 100% no-repeat, linear-gradient(#fff, #fff) 50% 34%/84px 14px no-repeat; }
.shema-kicker { font-size: 11.5px; font-weight: 700; opacity: .8; letter-spacing: .02em; }
.shema-title { font-size: 26px; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; margin-top: 2px; }
.shema-sub { font-size: 13px; opacity: .88; margin-top: 2px; }
.shema-stats { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.shema-stats span { display: inline-flex; align-items: center; gap: 5px; background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 700; }
.shema-stats svg { width: 15px; height: 15px; }
.shema-stats b { font-size: 15px; }
.auth .logo img.church { width: 200px; height: auto; border-radius: 0; box-shadow: none; }
.auth .shema { text-align: left; margin-top: 14px; }

/* ── 성경·새벽 토글 */
.habits { display: flex; gap: 5px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.hb { display: inline-flex; align-items: center; gap: 3px; border: 1.5px solid var(--line); background: #fff; color: var(--ink-3); border-radius: 999px; padding: 3px 9px 3px 7px; font-size: 12px; font-weight: 700; cursor: pointer; min-height: 28px; }
.hb svg { width: 14px; height: 14px; }
.hb.on { background: #fff6dc; border-color: #f1c34f; color: #8a5a00; }
.hb[data-habit="bible"].on { background: #e9f0ff; border-color: var(--peri); color: var(--navy); }

/* ── 행사·인원조사 */
.event-card { display: block; color: inherit; margin-bottom: 10px; }
.event-card.closed { opacity: .7; }
.rbar { display: flex; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 12px; }
.rbar i { display: block; height: 100%; }
.rbar .yes { background: var(--navy); }
.rbar .maybe { background: #f1c34f; }
.rbar .no { background: #e8a1ad; }
.rlegend { display: flex; gap: 12px; font-size: 12.5px; margin-top: 6px; color: var(--ink-2); flex-wrap: wrap; }
.rlegend b { color: var(--ink); }
.rsel { display: flex; gap: 4px; flex-shrink: 0; }
.rsel button { border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 0 9px; height: 40px; font-weight: 800; font-size: 13px; color: var(--ink-3); cursor: pointer; }
.rsel button.yes.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.rsel button.maybe.on { background: #fff3cf; border-color: #f1c34f; color: #8a5a00; }
.rsel button.no.on { background: var(--absent-soft); border-color: #f3c3cb; color: var(--absent); }
.rsel button:disabled { cursor: default; }

.tabbar a { font-size: 11px; }
@media (max-width: 360px) { .tabbar a { font-size: 10px; } .tabbar a svg { width: 22px; height: 22px; } .mark { width: 56px; } }

/* 로고 = 홈 버튼 */
a.brand { color: var(--navy); text-decoration: none; border-radius: 12px; padding: 2px 4px; margin: -2px -4px; }
a.brand:active { background: var(--peri-soft); }
.topbar .icon-btn { flex-shrink: 0; }

/* ── 공문서 양식 보고서 */
.doc-wrap { margin-top: 14px; overflow-x: auto; }
.doc { background: #fff; color: #111; width: 100%; max-width: 820px; margin: 0 auto; padding: 34px 38px 40px; box-shadow: 0 4px 24px rgba(15, 25, 60, .12); border-radius: 4px; font-size: 13.5px; line-height: 1.6; position: relative; }
.doc .sign { position: absolute; right: 38px; top: 26px; border-collapse: collapse; font-size: 11.5px; }
.doc .sign th, .doc .sign td { border: 1px solid #333; width: 56px; text-align: center; padding: 3px; font-weight: 600; }
.doc .sign th.lbl { width: 22px; line-height: 1.3; }
.doc .sign td { height: 46px; }
.doc .org { text-align: center; font-size: 25px; font-weight: 900; letter-spacing: .06em; margin: 8px 0 2px; }
.doc .slogan { text-align: center; font-size: 11.5px; letter-spacing: .2em; color: #23408f; font-weight: 700; margin-bottom: 18px; }
.doc table.meta { width: 100%; border-collapse: collapse; border-top: 2px solid #111; border-bottom: 2px solid #111; margin-bottom: 16px; }
.doc table.meta th { width: 84px; text-align: left; padding: 6px 4px; font-weight: 800; white-space: nowrap; }
.doc table.meta td { padding: 6px 4px; }
.doc table.meta td.title { font-weight: 800; font-size: 15px; }
.doc table.meta tr + tr { border-top: 1px solid #ddd; }
.doc .p1 { margin: 14px 0 8px; }
.doc h3 { font-size: 14px; margin: 18px 0 6px 12px; }
.doc .note { font-size: 12px; color: #444; margin: 4px 0 0 12px; }
.doc table.dt { width: calc(100% - 12px); margin-left: 12px; border-collapse: collapse; font-size: 12.5px; }
.doc table.dt th { background: #eef2fb; border: 1px solid #9aa6c4; padding: 5px 4px; font-weight: 800; }
.doc table.dt td { border: 1px solid #b7c0d6; padding: 4px; text-align: center; }
.doc table.dt td.none { color: #888; }
.doc table.dt tfoot td { font-weight: 800; background: #f6f8fe; }
.doc .doc-chart { display: block; width: calc(100% - 12px); margin: 10px 0 0 12px; }
.doc .sender { text-align: center; margin: 36px 0 10px; }
.doc .sender .date { font-size: 14px; }
.doc .sender .name { font-size: 20px; font-weight: 900; letter-spacing: .08em; margin-top: 10px; }
.doc .sender .by { font-size: 11.5px; color: #555; margin-top: 4px; }
.doc .attach { margin-top: 30px; border-top: 1px dashed #bbb; padding-top: 10px; }
@media (max-width: 640px) { .doc { padding: 22px 16px 28px; font-size: 12.5px; } .doc .sign { position: static; margin-left: auto; } .doc .org { margin-top: 14px; font-size: 21px; } }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  html, body { background: #fff !important; }
  .topbar, .tabbar, .side-nav, .no-print, #toast, #sheet-root { display: none !important; }
  .shell, .app-main { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .doc-wrap { margin: 0; overflow: visible; }
  .doc { box-shadow: none; max-width: none; padding: 0; border-radius: 0; font-size: 12.5px; }
  .doc .sign { right: 0; top: 0; }
  .doc .attach { break-before: page; border: 0; margin-top: 0; }
  .doc table.dt, .doc .doc-chart { break-inside: avoid; }
  .doc h3 { break-after: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.hb.pray.on { background: #fdeef3; border-color: #f0b3c4; color: #b23a5c; }

/* ── 이번 주일 · 체크 전 표시 */
.kpi.this { border: 2px solid var(--peri); }
.kpi.pending b { color: var(--ink-3); font-size: 22px; }
.bars .b.pending i { background: transparent; border: 2px dashed var(--peri); }
.bars .b.pending i::before { color: var(--ink-3); font-weight: 700; }
small.this-sun { color: var(--blue); font-size: 10px; font-weight: 800; }
.officers { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0 10px; align-items: end; margin-top: 12px; }
.officers .btn { margin-bottom: 12px; }
@media (max-width: 560px) { .officers { grid-template-columns: 1fr 1fr; } .officers .btn { grid-column: 1 / -1; } }

/* ── 차트 공용 */
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: #e9edf6; }
.chart .ax { fill: var(--ink-3); font-size: 11px; font-family: inherit; }
.chart .dl { fill: var(--ink); font-size: 12px; font-weight: 800; font-family: inherit; }
.chart .hit { cursor: crosshair; }
.chart .hit.hot { fill: rgba(35, 64, 143, .05); }
#chart-tip { position: fixed; z-index: 70; pointer-events: none; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(15, 25, 60, .16); opacity: 0; transition: opacity .1s; max-width: 240px; }
#chart-tip.show { opacity: 1; }
#chart-tip i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.legend-row { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin: -4px 0 4px; }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ── 대시보드 */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.dash > * { grid-column: span 12; min-width: 0; }
.dash .kpi { display: block; color: inherit; }
.dash .kpi span { display: block; }
.dash .kpi b small { font-size: 14px; color: var(--ink-3); font-weight: 700; margin-left: 2px; }
.dash .kpi.link:hover { box-shadow: 0 4px 16px rgba(35, 64, 143, .14); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.panel h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.panel h3 small { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.panel h3 .more { margin-left: auto; font-size: 12.5px; font-weight: 700; }
.hbars { display: grid; gap: 9px; }
.hb-row { display: grid; grid-template-columns: 44px 1fr 46px; align-items: center; gap: 8px; font-size: 13px; cursor: default; }
.hb-row .lbl { font-weight: 800; }
.hb-row .track { height: 12px; background: var(--peri-soft); border-radius: 4px; overflow: hidden; }
.hb-row .track i { display: block; height: 100%; background: var(--navy); border-radius: 0 4px 4px 0; }
.hb-row .val { text-align: right; font-weight: 800; color: var(--ink-2); }
.hb-row.hot .track i { background: var(--blue); }
.heat-wrap { overflow-x: auto; }
table.heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 12px; }
table.heatmap th { color: var(--ink-3); font-weight: 700; padding: 2px 4px; white-space: nowrap; }
table.heatmap tbody th { text-align: left; color: var(--ink); }
table.heatmap td { text-align: center; height: 30px; min-width: 34px; border-radius: 6px; background: #f3f5fa; font-weight: 700; }
table.heatmap td.hot { outline: 2px solid var(--blue); }
.mini-list { display: grid; gap: 4px; }
.mini { display: flex; gap: 10px; align-items: center; color: inherit; padding: 6px; border-radius: 12px; }
.mini:hover { background: var(--peri-soft); }
.mini .avatar { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
.ev, .pr { display: block; color: inherit; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ev:last-child, .pr:last-child { border-bottom: 0; }
.table-wrap.flat { box-shadow: none; }

/* ── PC: 사이드 메뉴 (1024px 이상) */
.side-nav { display: none; }
@media (min-width: 1024px) {
  body { font-size: 15px; }
  .side-nav {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 40;
    background: #fff; border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto;
  }
  .side-brand { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px 12px; color: var(--navy); font-weight: 800; }
  .side-brand img { width: 150px; height: auto; }
  .side-theme { margin: 0 4px 12px; padding: 12px 14px; border-radius: 14px; color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
    background: linear-gradient(135deg, #1a3478, #3a64c8); }
  .side-theme b { display: block; font-size: 18px; letter-spacing: -.02em; margin-top: 2px; }
  .side-dept { padding: 0 4px 10px; }
  .side-dept select { width: 100%; max-width: none; }
  .side-dept-name { padding: 0 10px 10px; font-weight: 800; color: var(--ink-2); }
  .side-nav nav { display: grid; gap: 2px; }
  .side-nav nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 700; position: relative; }
  .side-nav nav a svg { width: 20px; height: 20px; flex-shrink: 0; }
  .side-nav nav a:hover { background: var(--bg); }
  .side-nav nav a.on { background: var(--peri-soft); color: var(--navy); }
  .side-nav nav a .badge { margin-left: auto; background: var(--absent); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
  .side-nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 6px; }
  .side-user { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 8px 0; border-top: 1px solid var(--line); }
  .side-user small { display: block; color: var(--ink-3); }
  .side-user .avatar { width: 38px; height: 38px; font-size: 13px; cursor: default; }

  .tabbar { display: none; }
  .topbar { display: none; }
  .shell { margin-left: 248px; max-width: 1240px; padding: 22px 32px 48px; }
  #main.wide, .shell { max-width: none; }
  #toast { bottom: 24px; }
  .sheet-bg { padding-left: 248px; }

  .dash .c3 { grid-column: span 3; }
  .dash .c4 { grid-column: span 4; }
  .dash .c6 { grid-column: span 6; }
  .dash .c8 { grid-column: span 8; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .roster { grid-template-columns: repeat(2, 1fr); }
  .shema-card { padding: 20px 24px; }
  .shema-title { font-size: 30px; }
  h1.page { font-size: 26px; }
  .bars { height: 200px; }
  .list .li:hover, .roster .srow:hover { background: #fafbff; }
}
@media (min-width: 1440px) { .roster { grid-template-columns: repeat(3, 1fr); } }

/* ── 생일 · 학교 */
.tag.bd { background: #fff1e6; color: #b45309; }
.bars.months { height: 120px; padding-top: 16px; }
.bars.months .b i { background: var(--peri); }
.bars.months .b:last-child i { background: var(--peri); }
.bars.months .b.now i { background: var(--navy); }
.bday-list { display: grid; gap: 2px; }
.bday { display: flex; align-items: center; gap: 8px; color: inherit; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.bday:last-child { border-bottom: 0; }
.bday .d { min-width: 46px; text-align: center; font-size: 11.5px; font-weight: 800; color: #b45309; background: #fff1e6; border-radius: 7px; padding: 2px 6px; }
.hbars.schools .hb-row { grid-template-columns: 76px 1fr 44px; }
.hbars.schools .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.two-col { display: grid; gap: 0 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; } }
.input.big { font-size: 20px; letter-spacing: .08em; }

/* 로그인: 교사/관리자 선택 */
.role-seg { margin-bottom: 12px; background: rgba(255, 255, 255, .7); }
.role-seg button { padding: 10px 4px; font-size: 15.5px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.role-seg button small { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.role-seg button.on small { color: var(--peri-mid); }
.topbar .icon-btn[data-logout] { color: var(--ink-3); }
.side-user .icon-btn { width: 34px; height: 34px; box-shadow: none; background: var(--bg); color: var(--ink-3); }

/* ── 보고서 A4 한 장 (결재판용) — 위의 보고서 규칙을 덮어씀 */
.doc { max-width: 794px; padding: 64px 60px 56px; font-size: 12.5px; line-height: 1.5; border-radius: 2px; }
.doc .org { font-size: 22px; margin: 0 0 2px; }
.doc .slogan { font-size: 10.5px; margin-bottom: 12px; }
.doc table.meta { margin-bottom: 10px; }
.doc table.meta th, .doc table.meta td { padding: 4px; }
.doc table.meta td.title { font-size: 14px; }
.doc .p1 { margin: 10px 0 4px; }
.doc .p1.end { margin-top: 14px; }
.doc h3 { font-size: 13px; margin: 12px 0 4px 10px; }
.doc h3 small { font-weight: 600; color: #555; font-size: 11px; }
.doc .note { font-size: 11px; margin: 3px 0 0 10px; }
.doc table.dt { width: calc(100% - 10px); margin-left: 10px; font-size: 11.5px; }
.doc table.dt th { padding: 3px; }
.doc table.dt td { padding: 2.5px 3px; }
.doc table.dt.compact th, .doc table.dt.compact td { font-size: 11px; white-space: nowrap; }
.doc .doc-chart { width: calc(100% - 10px); margin: 4px 0 0 10px; max-height: 118px; }
.doc .doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.doc .doc-grid h3 { margin-left: 10px; }
.doc .ln { margin-left: 10px; font-size: 11.5px; border-top: 1px solid #b7c0d6; }
.doc .ln > div { padding: 2.5px 2px; border-bottom: 1px solid #e3e7f0; }
.doc .ln span { color: #555; }
.doc .ln .none, .doc .more-n { color: #888; }
.doc .ln.notes > div { white-space: normal; }
.doc .sender { margin: 22px 0 0; }
.doc .sender .date { font-size: 13px; }
.doc .sender .name { font-size: 18px; margin-top: 8px; }
.doc .sender .by { font-size: 11px; }
.fit-badge { text-align: center; color: var(--ok); font-weight: 700; font-size: 13px; margin: 10px 0 0; }
@media (max-width: 640px) { .doc { padding: 22px 14px 26px; } .doc .doc-grid { grid-template-columns: 1fr; } }

@media print {
  @page { size: A4 portrait; margin: 18mm 16mm; }
  .doc { padding: 0 !important; max-width: none; width: auto; zoom: var(--print-zoom, 1); }
  .doc .doc-grid { grid-template-columns: 1fr 1fr !important; }
  .fit-badge { display: none !important; }
}

/* ── 대문 그림 (로그인 화면 · PC 대시보드) */
.hero-card { position: relative; border-radius: 22px; overflow: hidden; background: linear-gradient(135deg, #1a3478, #3a64c8); box-shadow: 0 8px 24px rgba(35, 64, 143, .22); color: #fff; text-align: left; }
.hero-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-card .hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px; background: linear-gradient(180deg, transparent, rgba(16, 32, 80, .78)); }
.hero-card.no-img .hero-text { position: static; background: none; padding: 16px 18px; }
.hero-card .shema-title { text-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.auth .shema { margin-top: 12px; }
.dash-hero { display: none; }
@media (min-width: 1024px) {
  .dash-hero { display: block; margin: 4px 0 14px; }
  .dash-hero .hero-card { display: grid; grid-template-columns: minmax(0, 460px) 1fr; align-items: stretch; }
  .dash-hero .hero-card img { aspect-ratio: 16 / 9; height: 100%; }
  .dash-hero .hero-card .hero-text { position: static; background: none; display: flex; flex-direction: column; justify-content: center; padding: 22px 30px; }
  .dash-hero .shema-title { font-size: 34px; }
}
.auth .logo .hero-card img { width: 100%; height: auto; border-radius: 0; box-shadow: none; }
