/* ── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font: 'Noto Sans KR', sans-serif;
  --bg: #F1F5F9;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --text2: #475569;
  --blue: #2563EB;
  --blue-lt: #EFF6FF;
  --green: #16A34A;
  --green-lt: #F0FDF4;
  --amber: #D97706;
  --amber-lt: #FFFBEB;
  --red: #DC2626;
  --red-lt: #FEF2F2;
  --sidebar: #0F172A;
  --sidebar-text: #94A3B8;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* ── Screen System ──────────────────────────────── */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; min-height: 100vh; }
#screen-admin.active { flex-direction: row; }

/* ═══════════════════════════════════════════════════
   ENTRANCE SCREEN
═══════════════════════════════════════════════════ */
.ent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--sidebar);
  color: white;
  padding: 0 24px;
  height: 56px;
  flex-shrink: 0;
  gap: 16px;
}

.ent-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.ent-nav-btn {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: -0.2px;
}

.ent-nav-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.ent-nav-btn.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-weight: 700;
}

.ent-nav-btn.teacher {
  color: #7DD3FC;
}

.ent-nav-btn.teacher:hover,
.ent-nav-btn.teacher.active {
  background: rgba(125,211,252,0.15);
  color: #7DD3FC;
}

.ent-logo {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.3px;
}

.ent-clock {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--sidebar-text);
  font-variant-numeric: tabular-nums;
}

/* Status banner */
.ent-status {
  padding: 13px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}
.ent-status.class-day    { background: var(--blue); color: #fff; }
.ent-status.makeup-day   { background: var(--amber); color: #fff; }
.ent-status.cancelled-day{ background: var(--red); color: #fff; }
.ent-status.no-class     { background: #E2E8F0; color: var(--text2); }

/* Body */
.ent-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 14px;
  overflow: hidden;
}

/* Info panels */
.ent-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ent-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ent-panel-title {
  padding: 9px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.ent-panel-body {
  padding: 12px 16px;
  min-height: 72px;
}

.hw-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.hw-item:last-child { border-bottom: none; }
.hw-item::before { content: '·'; color: var(--blue); font-size: 1.4rem; line-height: 0.8; flex-shrink: 0; }

.hw-empty { color: var(--text2); font-size: 0.9rem; padding: 6px 0; }

/* 미제출 숙제 블록 */
.hw-item-block {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.hw-item-block:last-child { border-bottom: none; }

.hw-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.hw-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.8rem;
  color: var(--text2);
}

.hw-item-who {
  color: var(--red);
}
.hw-item-who strong {
  font-weight: 700;
}



.schedule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.schedule-row:last-child { border-bottom: none; }

.sch-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sch-dot.green  { background: var(--green); }
.sch-dot.red    { background: var(--red); }
.sch-dot.amber  { background: var(--amber); }
.sch-dot.gray   { background: #CBD5E1; }

.sch-lbl  { font-weight: 700; min-width: 100px; }
.sch-time { color: var(--text2); font-size: 0.85rem; flex: 1; }

.sch-tag {
  font-size: 0.72rem;
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 700;
}
.sch-tag.green  { background: var(--green-lt); color: var(--green); }
.sch-tag.red    { background: var(--red-lt); color: var(--red); }
.sch-tag.amber  { background: var(--amber-lt); color: var(--amber); }

/* Check-in area */
.ent-checkin-area {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.ent-checkin-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.ent-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  flex: 1;
}

.student-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--white);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s, border-color 0.15s;
  min-height: 90px;
}
.student-card:active { transform: scale(0.96); }
.student-card.checked-in { border-color: var(--green); background: var(--green-lt); }

.card-name {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
}
.student-card.checked-in .card-name { color: var(--green); }

.card-status { font-size: 0.82rem; color: var(--text2); font-weight: 500; }
.student-card.checked-in .card-status { color: var(--green); font-weight: 700; }

.ent-admin-link {
  align-self: flex-end;
  margin: 4px 16px 10px;
  font-size: 0.76rem;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  font-family: var(--font);
}

/* ═══════════════════════════════════════════════════
   LOGIN SCREEN
═══════════════════════════════════════════════════ */
#screen-login {
  background: var(--bg);
  justify-content: center;
  align-items: center;
}

.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
}

.login-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-icon { font-size: 2.5rem; }
.login-box h2 { font-size: 1.4rem; font-weight: 900; }

.login-pw {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1.1rem;
  font-family: var(--font);
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.login-pw:focus { border-color: var(--blue); }

.pw-err { color: var(--red); font-size: 0.85rem; min-height: 18px; }

.login-btn {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.login-btn:hover { background: #1D4ED8; }

.login-back {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font);
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════
   ADMIN CONSOLE
═══════════════════════════════════════════════════ */
.adm-layout { display: flex; width: 100%; min-height: 100vh; }

/* Sidebar */
.adm-sidebar {
  width: 210px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.adm-sidebar-top {
  padding: 22px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.adm-brand { font-size: 0.95rem; font-weight: 900; color: white; }
.adm-role  { font-size: 0.72rem; color: #475569; margin-top: 2px; }

.adm-sidebar nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  gap: 2px;
}

.adm-nav {
  display: block;
  width: 100%;
  padding: 10px 18px;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-family: var(--font);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.adm-nav:hover { background: rgba(255,255,255,0.06); }
.adm-nav.active { background: var(--blue); color: white; font-weight: 700; }

.adm-logout {
  padding: 14px 18px;
  background: none;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  color: #475569;
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.12s;
}
.adm-logout:hover { color: var(--sidebar-text); }

/* Main content */
.adm-main {
  flex: 1;
  background: var(--bg);
  overflow-y: auto;
  min-height: 100vh;
}

.adm-tab { display: none; padding: 28px; max-width: 1200px; }
.adm-tab.active { display: block; }

.tab-hd {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.tab-hd h2 { font-size: 1.3rem; font-weight: 900; }
.tab-desc { font-size: 0.83rem; color: var(--text2); margin-top: 4px; }
.tab-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Form Elements ── */
.fgrp { display: flex; flex-direction: column; gap: 4px; }
.fgrp label { font-size: 0.75rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px; }
.opt { font-weight: 400; text-transform: none; letter-spacing: 0; }
.fgrp-grow { flex: 1; min-width: 180px; }

.finput {
  padding: 9px 11px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  background: var(--white);
  transition: border-color 0.14s;
}
.finput:focus { border-color: var(--blue); }

.finput-sm {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.84rem;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  background: var(--white);
}

.ftextarea {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  resize: vertical;
  width: 100%;
}
.ftextarea:focus { border-color: var(--blue); }

/* ── Homework Multi-Row Form ── */
.hw-date-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.hw-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.hw-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

.hw-row-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hw-row .hw-row-title { flex: 2; min-width: 160px; }
.hw-row .hw-row-note  { flex: 1; min-width: 100px; }

.hw-row-del {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--text2);
  font-size: 0.78rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s, color 0.1s;
}
.hw-row-del:hover { background: var(--red-lt); color: var(--red); border-color: var(--red); }

.hw-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
}


/* ── Buttons ── */
.btn-add {
  background: var(--blue); color: white; border: none;
  border-radius: 7px; padding: 9px 18px;
  font-size: 0.88rem; font-weight: 700; cursor: pointer;
  font-family: var(--font); white-space: nowrap; align-self: flex-end;
  transition: background 0.13s;
}
.btn-add:hover { background: #1D4ED8; }

.btn-pri {
  background: var(--blue); color: white; border: none;
  border-radius: 7px; padding: 8px 16px;
  font-size: 0.86rem; font-weight: 700; cursor: pointer;
  font-family: var(--font); white-space: nowrap;
  transition: background 0.13s;
}
.btn-pri:hover { background: #1D4ED8; }

.btn-sec {
  background: var(--white); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 7px;
  padding: 8px 16px; font-size: 0.86rem; font-weight: 600;
  cursor: pointer; font-family: var(--font); white-space: nowrap;
  transition: border-color 0.13s;
}
.btn-sec:hover { border-color: var(--blue); color: var(--blue); }

.btn-del {
  background: none; border: none; color: var(--red);
  cursor: pointer; font-size: 0.84rem; padding: 4px 8px;
  border-radius: 5px; font-family: var(--font);
}
.btn-del:hover { background: var(--red-lt); }

/* ── Homework Form ── */
.hw-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hw-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }

/* ── Homework Table ── */
.hw-table-scroll { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }

.hw-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.87rem;
}
.hw-table th {
  background: var(--sidebar);
  color: white;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}
.hw-table th.left { text-align: left; }
.hw-table td {
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.hw-table td.left { text-align: left; max-width: 220px; white-space: normal; }
.hw-table tr:last-child td { border-bottom: none; }
.hw-table tr:hover td { background: #F8FAFC; }

/* Status toggle buttons */
.status-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--white); cursor: pointer;
  font-size: 1rem; font-weight: 900;
  transition: all 0.1s; font-family: var(--font);
}
.status-btn.o-s  { background: var(--green-lt); border-color: var(--green); color: var(--green); }
.status-btn.x-s  { background: var(--red-lt); border-color: var(--red); color: var(--red); }
.status-btn.d-s  { color: #CBD5E1; }

/* ── Capture Area (homework image export) ── */
.capture-scroll { overflow-x: auto; padding-bottom: 20px; }

.hw-capture {
  display: inline-block;
  background: white;
  padding: 28px 22px;
  min-width: 560px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.cap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.88rem;
}
.cap-header strong { font-weight: 900; }
.cap-footer { text-align: right; margin-top: 10px; font-size: 0.7rem; color: #94A3B8; }

.cap-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.cap-table th {
  background: #1E293B; color: white;
  padding: 7px 9px; text-align: center;
  font-weight: 700; font-size: 0.76rem;
  border: 1px solid #374151; white-space: nowrap;
}
.cap-table th.left { text-align: left; }
.cap-table td {
  border: 1px solid #E5E7EB;
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.cap-table td.left   { text-align: left; font-weight: 600; }
.cap-table td.dc     { font-size: 0.75rem; color: #374151; background: #F9FAFB; }
.cap-table td.oc     { color: #059669; font-weight: 900; }
.cap-table td.xc     { color: #DC2626; font-weight: 900; }
.cap-table td.dash   { color: #CBD5E1; }
.cap-table td.nc     { text-align: left; font-size: 0.75rem; color: #6B7280; }
.cap-table tr.gs td  { border-top: 2px solid #9CA3AF; }

/* ── Notice Builder ── */
.notice-builder {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-width: 500px;
}
.notice-btns { display: flex; gap: 10px; }
.notice-preview-wrap { overflow-x: auto; }

/* ── Attendance Table ── */
.att-table {
  width: 100%; border-collapse: collapse;
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); font-size: 0.87rem;
}
.att-table th { background: var(--sidebar); color: white; padding: 9px 11px; text-align: center; font-size: 0.78rem; font-weight: 700; }
.att-table td { padding: 8px 11px; border-bottom: 1px solid var(--border); text-align: center; }
.att-table tr:last-child td { border-bottom: none; }

/* ── Exception / Student forms ── */
.exc-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.exc-item, .stu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.exc-badge {
  font-size: 0.72rem; padding: 2px 10px;
  border-radius: 20px; font-weight: 700;
}
.exc-badge.cancelled { background: var(--red-lt); color: var(--red); }
.exc-badge.makeup    { background: var(--amber-lt); color: var(--amber); }

.stu-name  { font-size: 1.05rem; font-weight: 700; }
.stu-phone { font-size: 0.84rem; color: var(--text2); }
.stu-contacts { display: flex; flex-wrap: wrap; gap: 6px 14px; flex: 1; }

/* Student add form grid */
.stu-form-grid {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}


/* ── Settings ── */
.tpl-desc { font-size: 0.82rem; color: var(--text2); margin-bottom: 10px; }
.tpl-btns { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.tpl-msg  { font-size: 0.82rem; color: var(--green); }

.set-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.set-section h3 { font-size: 1rem; font-weight: 700; }

/* ── Utilities ── */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.empty-msg { text-align: center; color: var(--text2); padding: 32px; font-size: 0.9rem; }

/* ── Homework Inline Description Input ── */
.hw-desc-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 0.82rem;
  font-family: var(--font);
  color: var(--text2);
  background: transparent;
  outline: none;
  transition: all 0.15s;
}
.hw-desc-input:hover {
  background: var(--bg);
  border-color: var(--border);
}
.hw-desc-input:focus {
  background: var(--white);
  border-color: var(--blue);
  color: var(--text);
  box-shadow: 0 0 0 2px var(--blue-lt);
}

/* ── Homework Overdue Alert Dashboard ── */
.hw-overdue-alert {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.overdue-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.overdue-card-icon {
  font-size: 1.2rem;
}

.overdue-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red);
}

.overdue-card-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.overdue-student-box {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.overdue-student-name {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 4px;
}

.overdue-hw-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.overdue-hw-item {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  line-height: 1.4;
}

.overdue-hw-title {
  font-weight: 700;
  color: var(--text2);
}

.overdue-hw-dates {
  color: #94A3B8;
  font-size: 0.75rem;
}

/* ── Calendar ─────────────────────────────────── */
.cal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-month-lbl {
  font-size: 1.15rem;
  font-weight: 900;
  min-width: 120px;
  text-align: center;
}

.cal-billing-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-billing-wrap label {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
  color: var(--text2);
}

.cal-billing-wrap select {
  min-width: 120px;
}

.cal-grid {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.cal-wd {
  padding: 10px 4px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text2);
}

.cal-wd.sun { color: #DC2626; }
.cal-wd.sat { color: #2563EB; }

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  min-height: 76px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-day:nth-child(7n) { border-right: none; }

.cal-day:hover:not(.empty) {
  background: #EFF6FF;
}

.cal-day.empty {
  cursor: default;
  background: #F8FAFC;
}

.cal-day-num {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.cal-day.sun .cal-day-num { color: #DC2626; }
.cal-day.sat .cal-day-num { color: #2563EB; }

.cal-day.holiday .cal-day-num { color: #DC2626; }
.cal-day.holiday { background: #FEF2F2; }
.cal-day.holiday:hover { background: #FEE2E2; }
.cal-day.holiday.has-session { background: color-mix(in srgb, var(--sc, #2563EB) 10%, #FEF2F2); }

.cal-day-holiday {
  font-size: 0.6rem;
  color: #DC2626;
  font-weight: 600;
  line-height: 1.2;
}

.cal-day-holiday.break {
  color: #7C3AED;
}

.cal-day.academy-break { background: #F5F3FF; }
.cal-day.academy-break:hover { background: #EDE9FE; }
.cal-day.academy-break.holiday { background: #FEF2F2; }

.cal-day.has-session {
  background: color-mix(in srgb, var(--sc, #2563EB) 10%, white);
}

.cal-day.has-session:hover {
  background: color-mix(in srgb, var(--sc, #2563EB) 18%, white);
}

.cal-day-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: var(--sc, #2563EB);
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  line-height: 1.5;
  width: fit-content;
}

/* 수업료 입력 */
.cal-tuition-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cal-tuition-bar label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text2);
  white-space: nowrap;
}

.cal-tuition-bar span {
  font-size: 0.88rem;
  color: var(--text2);
}

/* 정산 요약 */
.cal-summary {
  margin-top: 16px;
}

.cal-summary-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.cal-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.cal-summary-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  transition: box-shadow 0.15s;
}

.cal-summary-card.active {
  box-shadow: 0 2px 8px rgba(37,99,235,0.12);
}

.cal-summary-month {
  font-size: 0.95rem;
  font-weight: 800;
}

.cal-summary-count {
  font-size: 0.8rem;
  color: var(--text2);
  margin-top: 3px;
}

.cal-summary-amt {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.cal-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.7;
}

/* ── Class Management ─────────────────────────── */
.class-mgmt-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.class-mgmt-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.class-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.class-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.class-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

.class-name {
  font-weight: 800;
  font-size: 1rem;
}

.class-count {
  font-size: 0.8rem;
  color: var(--text2);
}

/* ── Makeup Management ────────────────────────── */
.makeup-add-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.makeup-add-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.makeup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.makeup-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.makeup-filter-bar label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text2);
}

.makeup-date-group {
  margin-bottom: 16px;
}

.makeup-date-hd {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text2);
  padding: 6px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 8px;
}

.makeup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  transition: opacity 0.2s;
}

.makeup-item.done {
  opacity: 0.5;
}

.makeup-check {
  font-size: 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 4px;
}

.makeup-check.checked { color: #16A34A; }

.makeup-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.makeup-who {
  font-weight: 700;
  font-size: 0.9rem;
}

.makeup-time {
  font-size: 0.8rem;
  color: var(--text2);
}

.makeup-note {
  font-size: 0.82rem;
  color: var(--text2);
  flex: 1;
}

.makeup-auto-badge {
  font-size: 0.68rem;
  background: #DBEAFE;
  color: #1E40AF;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* ── Student edit mode ────────────────────────── */
.stu-item.editing {
  border: 2px solid #2563EB;
  background: #EFF6FF;
}

.stu-class-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  background: #7C3AED;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
}
