/* css/app.css - 자람학원: 밤하늘 남색 + 햇살 노랑 + 산호 + 민트, 우유빛 바탕, 모서리 20px
   글꼴: 주아(제목 · 숫자) + 고운돋움(글). 휴대폰 먼저 - 넓은 화면에서는 위쪽 탭, 좁으면 아래쪽 탭 */
:root {
    --navy: #1D2B53; --navy-2: #2C3B68; --yellow: #FFC83D; --coral: #E8573A; --coral-ink: #B83A20; --mint: #7CC8B4; --mint-ink: #1E6B57;
    --cream: #FFF8EC; --sand: #EADFC8; --ink: #1D2B53; --muted: #5A6482; --white: #FFFFFF;
    --r: 20px; --r-sm: 14px;
    --display: 'Jua', 'Gowun Dodum', sans-serif; --body: 'Gowun Dodum', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--cream); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, .num, .big { font-family: var(--display); font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.empty { color: var(--muted); margin: 6px 0; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: var(--r-sm); border: 2px solid transparent; font-family: var(--display); font-size: 17px; text-decoration: none; cursor: pointer; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-ghost { background: var(--white); border-color: var(--sand); color: var(--navy); }
.btn-small { background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.5); color: var(--white); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.link { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lang { display: inline-flex; background: rgba(255, 255, 255, 0.15); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: none; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 13px; color: inherit; }
.lang button.on { background: var(--yellow); color: var(--navy); }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); }
.login-card { width: min(520px, 100%); background: var(--cream); border-radius: 32px; padding: 34px 28px; }
.login-card h1 { font-size: 34px; margin: 20px 0 4px; }
.logo-row { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-row b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.logo { width: 38px; height: 38px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-family: var(--display); font-size: 20px; }
.login-picks { display: grid; gap: 12px; margin: 22px 0 16px; }
.login-pick { text-align: left; border: 0; border-radius: var(--r); padding: 18px 20px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.login-pick b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.login-pick small { font-size: 14px; opacity: 0.85; }
.login-pick span { font-size: 14px; }
.tone-yellow { background: var(--yellow); color: var(--navy); }
.tone-mint { background: var(--mint); color: #12332B; }
.tone-coral { background: var(--coral); color: var(--white); }
.login-pick:hover { transform: translateY(-2px); }
.login-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.login-foot .lang { background: var(--sand); }

/* 틀 */
.top { background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1080px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 20px; }
.top .logo-row b { color: var(--white); }
.tabs { display: flex; gap: 4px; }
.tabs a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-family: var(--display); font-size: 17px; color: rgba(255, 255, 255, 0.8); }
.tabs a:hover { color: var(--white); background: var(--navy-2); }
.tabs a.on { background: var(--yellow); color: var(--navy); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { font-size: 14px; opacity: 0.85; }
.kid-bar { max-width: 1080px; margin: 14px auto 0; padding: 0 20px; }
.kids { display: inline-flex; background: var(--white); border-radius: 999px; padding: 4px; gap: 4px; box-shadow: 0 2px 0 var(--sand); }
.kids button { border: 0; background: none; border-radius: 999px; padding: 8px 18px; font-family: var(--display); font-size: 17px; cursor: pointer; }
.kids button.on { background: var(--navy); color: var(--white); }
.view { max-width: 1080px; margin: 0 auto; padding: 22px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.foot { max-width: 1080px; margin: 0 auto; padding: 8px 20px 30px; font-size: 13px; color: var(--muted); }
.bottom { display: none; }

/* 머리 · 카드 */
.page-head h1 { font-size: 34px; margin: 0; }
.page-head p { margin: 2px 0 0; }
.back { font-size: 14px; color: var(--muted); text-decoration: none; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.card { background: var(--white); border-radius: var(--r); padding: 20px; min-width: 0; }
.card h2 { font-size: 22px; margin: 0 0 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.card-head > a { font-size: 14px; color: var(--muted); }
.card-alert { background: var(--coral); color: var(--white); }
.card-alert h2 { margin: 0; }
.hero-card { background: var(--yellow); border-radius: 28px; padding: 26px 24px; }
.hero-card h1 { font-size: 34px; margin: 4px 0 0; line-height: 1.25; }
.chip-white { display: inline-block; margin-top: 12px; background: var(--white); border-radius: 999px; padding: 7px 14px; font-size: 15px; }
.row-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--sand); }
.row-card:last-child { border-bottom: 0; }
.row-card > div { flex: 1; min-width: 0; }
.row-card b { display: block; }
.row-card small { display: block; color: var(--muted); font-size: 14px; }
.link-row { text-decoration: none; }
.dotc { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.due { font-size: 13px; color: var(--coral-ink); white-space: nowrap; }
.amount { font-family: var(--display); font-size: 18px; white-space: nowrap; }
.big { font-size: 26px; margin: 10px 0 0; }
.up { color: var(--coral-ink); font-style: normal; font-size: 22px; }
.down { color: var(--muted); font-style: normal; font-size: 22px; }
.pill { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 13px; white-space: nowrap; }
.pill-present { background: var(--mint); color: #12332B; }
.pill-late { background: var(--yellow); color: var(--navy); }
.pill-absent { background: #FBE1DA; color: var(--coral-ink); }
.pill-planned { background: #EEF0F6; color: var(--navy); }
.pill-none { background: var(--cream); color: var(--muted); }
.bubble { margin: 0 0 12px; background: var(--cream); border-radius: 18px 18px 18px 4px; padding: 14px 16px; font-size: 16px; line-height: 1.6; }
.bubble cite { display: block; margin-top: 6px; font-style: normal; font-size: 13px; color: var(--muted); }
.notice { border-bottom: 1px dashed var(--sand); padding: 10px 0; }
.notice summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; list-style: none; }
.notice summary small { color: var(--muted); white-space: nowrap; }
.notice p { margin: 8px 0 0; color: var(--muted); }

/* 숙제 */
.progress { height: 14px; background: var(--sand); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--mint); border-radius: 999px; }
.checks { display: grid; gap: 10px; margin: 14px 0; }
.check-card { display: flex; align-items: center; gap: 14px; background: var(--cream); border: 2px solid transparent; border-radius: var(--r); padding: 14px 16px; cursor: pointer; }
.check-card input { width: 24px; height: 24px; accent-color: var(--mint-ink); flex-shrink: 0; }
.check-card span { flex: 1; min-width: 0; }
.check-card b { display: block; }
.check-card small { color: var(--muted); }
.check-card em { font-style: normal; font-size: 13px; color: var(--muted); white-space: nowrap; }
.check-card.on { background: #E5F5F0; }
.check-card.on b { text-decoration: line-through; text-decoration-color: var(--mint-ink); }
.check-card.late { border-color: var(--coral); }
.check-card.late em { color: var(--coral-ink); }
.hw-row { border-bottom: 1px dashed var(--sand); padding: 10px 0; }
.hw-row summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.hw-row summary > span:first-child { flex: 1; min-width: 0; }
.hw-row b { display: block; }
.hw-row small { color: var(--muted); }
.mini { width: 80px; height: 10px; background: var(--sand); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.mini span { display: block; height: 100%; background: var(--mint); }

/* 성적 막대 */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 190px; padding: 0 4px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar span { width: 100%; background: var(--sand); border-radius: 10px; }
.bar b { font-size: 15px; color: var(--muted); }
.bar.last b { color: var(--navy); font-size: 18px; }
.bar small { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* 입력 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.form input:not([type="checkbox"]), .form select, .form textarea { min-height: 48px; border: 2px solid var(--sand); border-radius: var(--r-sm); padding: 0 14px; background: var(--white); font-size: 16px; }
.form textarea { padding: 12px 14px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--navy); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inline { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px; }
.inline input { min-height: 40px; border: 2px solid var(--sand); border-radius: 12px; padding: 0 10px; background: var(--white); }
.checkset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.checkset legend { font-size: 15px; margin-bottom: 6px; padding: 0; }
.checkset label { flex-direction: row; align-items: center; gap: 6px; background: var(--cream); border-radius: 999px; padding: 6px 14px; }
.row-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.score-in { width: 80px; min-height: 40px; border: 2px solid var(--sand); border-radius: 10px; padding: 0 10px; text-align: center; font-family: var(--display); font-size: 17px; }

/* 수업 · 출석 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.class-card { background: var(--white); border-radius: var(--r); padding: 18px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; border-top: 8px solid var(--c); }
.class-card:hover { transform: translateY(-2px); }
.class-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.class-top b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.class-card small { color: var(--muted); font-size: 14px; }
.class-count { margin-top: 10px; font-size: 15px; }
.class-count b { font-size: 30px; }
.roster { list-style: none; margin: 8px 0 0; padding: 0; }
.roster li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--sand); flex-wrap: wrap; }
.roster li > div:nth-child(2) { flex: 1; min-width: 120px; }
.roster b { display: block; }
.roster small { color: var(--muted); font-size: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; font-family: var(--display); flex-shrink: 0; }
.seg { display: inline-flex; background: var(--cream); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 14px; min-height: 40px; }
.seg button:disabled { opacity: 0.5; cursor: default; }
.seg .on-present { background: var(--mint); color: #12332B; }
.seg .on-late { background: var(--yellow); }
.seg .on-absent { background: var(--coral); color: var(--white); }

/* 칩 · 표 · 숫자 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 2px solid var(--sand); background: var(--white); border-radius: 999px; padding: 8px 16px; cursor: pointer; font-family: var(--display); font-size: 16px; }
.chip.on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.table th { text-align: left; font-weight: 400; font-size: 13px; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 2px solid var(--sand); white-space: nowrap; }
.table td { padding: 10px 10px 10px 0; border-bottom: 1px dashed var(--sand); }
.table td.num { font-size: 17px; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; background: var(--cream); border-left: 6px solid var(--c); margin: 1px 0; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--white); border-radius: var(--r); padding: 16px 18px; text-decoration: none; display: flex; flex-direction: column; }
.kpi small { color: var(--muted); font-size: 14px; }
.kpi b { font-size: 38px; line-height: 1.2; }
.kpi b.small-num { font-size: 24px; }
.kpi span { font-size: 15px; }
.kpi-coral { background: var(--coral); color: var(--white); }
.kpi-coral small { color: rgba(255, 255, 255, 0.85); }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--navy); color: var(--white); padding: 12px 20px; border-radius: 999px; font-size: 15px; z-index: 50; max-width: calc(100% - 32px); text-align: center; }

/* 휴대폰: 위쪽 탭을 아래쪽 탭으로 */
@media (max-width: 820px) {
    .tabs { display: none; }
    .who { display: none; }
    .top-in { padding: 10px 16px; gap: 10px; }
    .view { padding: 16px 16px 110px; }
    .foot { padding-bottom: 100px; }
    .bottom { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--white); border-top: 2px solid var(--sand); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
    .bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: 12px; color: var(--muted); padding: 4px 0; }
    .bottom svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .bottom a.on { color: var(--coral-ink); }
    .cols, .two { grid-template-columns: minmax(0, 1fr); }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpis-3 { grid-template-columns: minmax(0, 1fr); }
    .hero-card h1, .page-head h1 { font-size: 28px; }
    .kid-bar { padding: 0 16px; }
}
