@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
  --bg: #f5f5f3;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.1);
  --text: #1a1a1a;
  --text-sub: #666;
  --text-hint: #999;
  --blue: #186E48;
  --blue-light: #E1F1E8;
  --blue-dark: #0E4A2E;
  --green: #3B6D11;
  --green-light: #EAF3DE;
  --red: #A32D2D;
  --red-light: #FCEBEB;
  --amber: #854F0B;
  --amber-light: #FAEEDA;
  --teal: #0F6E56;
  --teal-light: #E1F5EE;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  overscroll-behavior-y: none;  /* 모바일에서 당겨서 새로고침 방지 */
}
body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.app { min-height: 100vh; }
.screen { display: none; }
.screen.active { display: block; }

/* ── Login ── */
#loginScreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0.75rem 1rem;
  background:
    radial-gradient(ellipse at top left, rgba(24,110,72,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(15,110,86,0.06) 0%, transparent 50%),
    linear-gradient(160deg, #f0f7ff 0%, #f5f5f3 60%);
}

.login-wrap { width: 100%; max-width: 460px; }
.login-logo { text-align: center; margin-bottom: 1rem; }
.login-logo .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 15px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  margin-bottom: 10px;
  box-shadow: 0 6px 16px rgba(24,110,72,0.25), 0 2px 4px rgba(24,110,72,0.15);
  position: relative;
  overflow: hidden;
}
.login-logo .brand-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
}
.login-logo .brand-mark svg { width: 32px; height: 32px; color: white; position: relative; z-index: 1; }
.login-logo h1 {
  font-size: 24px; font-weight: 700; color: var(--blue-dark);
  letter-spacing: -0.5px; line-height: 1.3;
  display: inline-flex; align-items: baseline; gap: 8px;
  margin: 0;
}
.login-logo .login-version {
  font-size: 12px; font-weight: 600;
  background: var(--blue-light); color: var(--blue);
  padding: 2px 9px; border-radius: 10px;
  letter-spacing: 0.5px;
}
.login-logo .sub { font-size: 12px; color: var(--text-hint); margin-top: 5px; letter-spacing: 0.3px; }

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 8px 24px rgba(24,110,72,0.08),
    0 20px 48px rgba(0,0,0,0.04);
}
.login-card .form-group { margin-bottom: 0.7rem; }
.login-card .form-group input {
  padding: 9px 13px; font-size: 14px;
}
.login-card .form-group label {
  margin-bottom: 4px;
}
.login-card .info-box {
  margin-bottom: 0.85rem;
  padding: 8px 12px;
  line-height: 1.5 !important;
  border-radius: 8px;
  font-size: 11px !important;
}
.login-card .login-submit {
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(24,110,72,0.18);
  transition: transform 0.15s, box-shadow 0.15s;
  padding: 10px;
}
.login-card .login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(24,110,72,0.28);
}
.login-card .login-submit:active { transform: translateY(0); }

.admin-login-btn {
  background: transparent; border: 1px solid transparent;
  color: var(--text-hint); font-size: 11.5px; cursor: pointer;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 8px;
  transition: all 0.15s;
}
.admin-login-btn:hover {
  color: var(--text-sub); background: var(--bg); border-color: var(--border);
}

.login-credit {
  text-align: center; font-size: 10.5px; color: var(--text-hint);
  margin-top: 8px;
}

/* 새 소식 알림 (로그인 화면) — 카운트 + 안내 형식 */

/* 새 소식 알림 (로그인 화면) — 카운트 + 안내 형식 */
.login-notices {
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid rgba(24,110,72,0.18);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(24,110,72,0.06);
  animation: loginNoticeSlide 0.3s ease-out;
}
@keyframes loginNoticeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.login-notices-header {
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--blue-light) 0%, #ebf4ef 100%);
  display: flex;
  align-items: center;
  user-select: none;
}
.login-notices-title {
  font-size: 12px; font-weight: 700;
  color: var(--blue-dark);
  display: flex; align-items: center; gap: 6px;
}
.login-notices-icon { font-size: 13px; }
.login-notices-body { padding: 6px 14px; }

.login-notice-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 0;
}
.login-notice-row + .login-notice-row {
  border-top: 1px solid var(--bg);
}
.ln-icon {
  font-size: 18px; flex-shrink: 0;
  width: 24px; text-align: center;
  padding-top: 1px;
}
.ln-text { flex: 1; min-width: 0; }
.ln-cat {
  font-size: 12.5px; font-weight: 600;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.ln-count {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  color: white; background: var(--blue);
  padding: 1px 8px; border-radius: 9px;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}
.ln-action {
  font-size: 11px; color: var(--text-hint);
  margin-top: 3px; line-height: 1.5;
}

.tab-row {
  display: flex; background: var(--bg);
  border-radius: var(--radius-sm); padding: 3px;
  margin-bottom: 1.5rem; gap: 2px;
}

.tab {
  flex: 1; padding: 7px; border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 13px; font-family: inherit; cursor: pointer;
  background: transparent; color: var(--text-sub);
  font-weight: 500; transition: all 0.15s;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-sub); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s; outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24,110,72,0.1);
}
.form-group textarea { resize: vertical; }

/* 필수 입력 표시 (*) */
.req-star {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 5px;
  margin-bottom: 2px;
  font-size: 0;
  line-height: 0;
}

/* 검증 실패: 빨간 테두리 강조 */
.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid,
button.invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(163,45,45,0.12) !important;
}

/* 강사 등급 - 항목별 점수 breakdown */
.bd-table {
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-width: 240px;
}
.bd-row {
  display: grid;
  grid-template-columns: 80px 1fr 44px;
  gap: 8px;
  padding: 1px 0;
  font-size: 11.5px;
  align-items: flex-start;
}
.bd-label {
  font-weight: 600; color: var(--text);
  padding-top: 1px;
}
.bd-reason {
  color: var(--text-sub); font-size: 11px;
  white-space: pre-line;
  line-height: 1.55;
  word-break: keep-all;
}
.bd-score {
  text-align: right; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bd-score.pos { color: var(--blue); }
.bd-score.zero { color: var(--text-hint); }
.bd-sum-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0 1px;
  margin-top: 3px;
  border-top: 1px solid var(--border);
  font-size: 12px; font-weight: 700;
  color: var(--text);
}
.bd-sum-val {
  color: var(--blue);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* 자격증 카테고리 체크박스 항목 */
.cert-cat-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 400; cursor: pointer;
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
  text-transform: none; letter-spacing: 0;
}
.cert-cat-item:hover { background: var(--blue-light); border-color: var(--blue); }
.cert-cat-item input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; margin: 0;
}
#pCertCatToggle:hover { border-color: var(--blue); }
#pCertCatToggle:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(24,110,72,0.1); }

.multi-input-group { margin-bottom: 1rem; }
.multi-input-group label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text-sub); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.multi-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.multi-row span {
  font-size: 12px; color: var(--text-hint);
  min-width: 18px; text-align: right; flex-shrink: 0;
}
.multi-row input {
  flex: 1; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.multi-row input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(24,110,72,0.08);
}

.day-grid {
  display: grid; grid-template-columns: 80px repeat(2, 1fr);
  gap: 4px; margin-top: 4px;
}
.day-header {
  font-size: 11px; font-weight: 700; color: var(--text-sub);
  padding: 4px 0; text-align: center;
}
.day-label {
  font-size: 13px; font-weight: 500; color: var(--text);
  padding: 6px 8px; display: flex; align-items: center;
}
.day-check { display: flex; align-items: center; justify-content: center; padding: 4px; }
.day-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }

.info-box {
  background: var(--blue-light); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 12px; color: var(--blue-dark);
  margin-bottom: 1rem; line-height: 1.7;
}

.btn {
  padding: 8px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-size: 13px;
  font-family: inherit; font-weight: 500; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
}
.btn:hover { background: var(--bg); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.danger:hover { background: #791F1F; }
.btn.green { background: var(--green); color: #fff; border-color: var(--green); }
.btn.green:hover { background: #27500A; }
.btn.full { width: 100%; margin-top: 4px; padding: 10px; }
.btn.sm { padding: 4px 10px; font-size: 12px; }

.err-msg {
  color: var(--red); font-size: 12px; margin-top: 8px;
  display: none; white-space: pre-line; line-height: 1.7;
}
.err-msg.info {
  color: var(--blue-dark); background: var(--blue-light);
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; border-left: 3px solid var(--blue);
}
.err-msg.success {
  color: var(--green); background: var(--green-light);
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; border-left: 3px solid var(--green);
}
.err-msg.warn {
  color: var(--amber); background: var(--amber-light);
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; border-left: 3px solid var(--amber);
}

.pending-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: white; border-radius: 10px;
  padding: 0 6px; font-size: 10px; font-weight: 700;
  margin-left: 4px; min-width: 16px; height: 16px; line-height: 1;
}

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 54px; background: var(--blue);
  position: sticky; top: 0; z-index: 10;
}
.topbar .title {
  font-size: 14px; font-weight: 700; color: #fff;
  letter-spacing: -0.3px; display: flex; align-items: center;
  gap: 8px; line-height: 1.3;
}
.topbar .title small {
  font-size: 10px; font-weight: 400; opacity: 0.7;
  display: block; letter-spacing: 0;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  font-size: 12px; font-weight: 500;
  color: #fff;
  background: rgba(255,255,255,0.18);
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.22);
}
.topbar .btn.sm {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.22); color: #fff;
  font-weight: 500;
}
.topbar .btn.sm:hover { background: rgba(255,255,255,0.28); }

/* ── Nav ── */
.nav {
  display: flex; gap: 2px; padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.nav-btn {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; font-weight: 500;
  cursor: pointer; background: transparent;
  border: none; color: var(--text-sub);
  white-space: nowrap; transition: all 0.15s;
  display: inline-flex; align-items: center;
}
.nav-btn:hover { background: var(--bg); color: var(--text); }
.nav-btn.active { background: var(--blue-light); color: var(--blue); }

/* ── Content ── */
.content { padding: 20px; max-width: 900px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 14px; font-weight: 700; color: var(--text); }

.badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 500;
}
.badge.pending { background: var(--amber-light); color: var(--amber); }
.badge.approved { background: var(--green-light); color: var(--green); }
.badge.rejected { background: #efeeeb; color: #6b6660; }
.badge.admin { background: var(--blue-light); color: var(--blue); }
.badge.day { background: var(--teal-light); color: var(--teal); }

.row-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 10px;
}
.row-item:last-child { border-bottom: none; }

.profile-row {
  display: flex; padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px; gap: 12px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .lbl { color: var(--text-sub); flex-shrink: 0; min-width: 80px; font-weight: 500; font-size: 12px; }
.profile-row .val { color: var(--text); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}

.inst-info { flex: 1; min-width: 0; }
.inst-name { font-size: 14px; font-weight: 500; }
.inst-sub { font-size: 12px; color: var(--text-sub); margin-top: 1px; }

/* ── Calendar ── */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav button {
  width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; background: var(--surface);
  font-size: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.cal-nav button:hover { background: var(--bg); }
.cal-month { font-size: 15px; font-weight: 700; min-width: 110px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-day-hdr {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  background: #F5F5F0;
  border-radius: 4px;
  padding: 6px 0;
  letter-spacing: 0.5px;
}
.cal-day-hdr.sun { color: #C62828; background: #FCEBEB; }
.cal-day-hdr.sat { color: #1565C0; background: #E6F1FB; }
.cal-day {
  min-height: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.cal-day:hover { border-color: var(--blue); background: var(--blue-light); }
.cal-day.other-month { background: var(--bg); opacity: 0.5; pointer-events: none; }
.cal-day.today { border-color: var(--blue); border-width: 2px; }
.cal-day.sun { background: #FFFAFA; }
.cal-day.sat { background: #FAFBFE; }
.cal-day.sun .day-num { color: #C62828; }
.cal-day.sat .day-num { color: #1565C0; }
.cal-day.today.sun, .cal-day.today.sat { background: var(--surface); }  /* 오늘 표시는 컬럼색보다 우선 */
.cal-day .day-num { font-size: 11px; color: var(--text-sub); font-weight: 500; margin-bottom: 1px; flex-shrink: 0; }
.cal-day.today .day-num { color: var(--blue); font-weight: 700; }

.ev-dot,
.visit-dot {
  font-size: 10px;
  border-radius: 3px;
  padding: 0 5px;
  height: 17px;
  line-height: 17px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  border-left: 3px solid currentColor;
  box-sizing: border-box;
  flex-shrink: 0;
}
.ev-dot { background: var(--blue-light); color: var(--blue); }
.visit-dot { font-weight: 600; }

.type-camp    { background: #E1F1E8; color: #186E48; }
.type-special { background: #E1F5EE; color: #0F6E56; }
.type-seminar { background: #FAEEDA; color: #854F0B; }
.type-club    { background: #F0E7FA; color: #6B3FA0; }
.type-etc     { background: #ECECEC; color: #555;    }

/* ─── 사무실 방문 신청 상태별 색상 ─── */
.visit-dot.pending  { background: #FFF3E0; color: #B85C00; }
.visit-dot.approved { background: #E6F4EA; color: #1A6B36; }
.visit-dot.rejected { background: #FDECEA; color: #B12318; }
.visit-dot.cancelled { background: #ECECEC; color: #777; text-decoration: line-through; }

/* ─── 이번 달 생일자 표시 ─── */
.birthday-dot {
  font-size: 10px;
  background: #FFF4D9;
  color: #B45309;
  border-radius: 3px;
  padding: 0 5px;
  height: 17px;
  line-height: 17px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  border-left: 3px solid #F59E0B;
  box-sizing: border-box;
  flex-shrink: 0;
  cursor: default;
}

.type-stripe {
  display: inline-block; width: 4px; height: 14px;
  border-radius: 2px; vertical-align: middle;
  margin-right: 7px; flex-shrink: 0;
}
.type-stripe.type-camp    { background: #186E48; }
.type-stripe.type-special { background: #0F6E56; }
.type-stripe.type-seminar { background: #854F0B; }
.type-stripe.type-club    { background: #6B3FA0; }
.type-stripe.type-etc     { background: #999;    }

.ev-item {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.15s;
}
.ev-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}
.ev-item:last-child { margin-bottom: 0; }
.ev-title { font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.ev-meta { font-size: 12px; color: var(--text-sub); }
.ev-desc { font-size: 12px; color: var(--text-hint); margin-top: 3px; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: break-word; }

/* 일정 카드 — 유형별 옅은 배경색 (시인성 향상) */
.ev-item.type-camp,    .notice-card.type-camp    { background: #F0F8F4; border-color: #C8E5D4; }
.ev-item.type-special, .notice-card.type-special { background: #EEF8F5; border-color: #BCDFD5; }
.ev-item.type-seminar, .notice-card.type-seminar { background: #FEF6EB; border-color: #F0DAB0; }
.ev-item.type-club,    .notice-card.type-club    { background: #F7F1FC; border-color: #E0CFF0; }
.ev-item.type-etc,     .notice-card.type-etc     { background: #F5F5F5; border-color: #E5E5E5; }

.search-panel {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 14px; margin-bottom: 14px; border: 1px solid var(--border);
}
.search-panel .search-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.search-panel .search-row:last-child { margin-bottom: 0; }
.search-panel input, .search-panel select {
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  font-family: inherit; color: var(--text);
  background: var(--surface); outline: none;
  flex: 1; min-width: 120px;
}
.search-panel input:focus, .search-panel select:focus { border-color: var(--blue); }

.day-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.day-filter-btn {
  padding: 4px 10px; border: 1px solid var(--border);
  border-radius: 20px; font-size: 12px;
  font-family: inherit; cursor: pointer;
  background: var(--surface); color: var(--text-sub);
  font-weight: 500; transition: all 0.12s;
}
.day-filter-btn.active-am { background: var(--blue-light); color: var(--blue); border-color: var(--blue); }
.day-filter-btn.active-pm { background: var(--teal-light); color: var(--teal); border-color: var(--teal); }

/* ── Modal ── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); display: none;
  align-items: center; justify-content: center;
  z-index: 200; padding: 1rem;
  backdrop-filter: blur(2px);
  overscroll-behavior: contain;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
  width: 100%; max-width: 480px; max-height: 88vh;
  overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  overscroll-behavior: contain;
}
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 1.25rem; letter-spacing: -0.3px; }
.modal-footer { display: flex; gap: 8px; margin-top: 1.25rem; flex-wrap: wrap; }

.app-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px; gap: 8px;
}
.app-row:last-child { border-bottom: none; }
.btn-grp { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

.admin-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.admin-row:last-child { border-bottom: none; }

.empty-msg { font-size: 13px; color: var(--text-sub); padding: 8px 0; }
.success-chip { font-size: 12px; color: var(--green); display: none; margin-left: 10px; }

.profile-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-hint); margin: 14px 0 6px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.profile-section-title:first-child { margin-top: 0; }

.footer-credit {
  text-align: center; padding: 16px;
  font-size: 11px; color: var(--text-hint);
  border-top: 1px solid var(--border);
  background: var(--surface); margin-top: 20px;
}

@media (max-width: 600px) {
  body { font-size: 16px; line-height: 1.7; }
  .content { padding: 12px; max-width: 100%; }
  .card { padding: 16px; margin-bottom: 13px; border-radius: 8px; }
  .modal {
    padding: 18px; max-height: 92vh; max-width: 100%;
    border-radius: 12px 12px 0 0; margin: auto 0 0;
  }
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal h3 { font-size: 19px; }
  .topbar { padding: 0 12px; height: 52px; }
  .topbar .title { font-size: 14px; gap: 5px; }
  .topbar .title small { font-size: 11px; }
  .topbar-right { gap: 7px; }

  .conn-status {
    padding: 4px; border-radius: 50%;
    width: 20px; height: 20px;
    gap: 0; justify-content: center;
  }
  .conn-status .conn-text { display: none; }
  .conn-status .conn-dot { width: 9px; height: 9px; }
  .conn-status.online .conn-dot { width: 11px; height: 11px; }

  .user-chip { font-size: 12px; padding: 4px 9px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .btn.sm { padding: 5px 10px; font-size: 13px; }

  .nav {
    padding: 7px 11px; gap: 5px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none; -ms-overflow-style: none;
    mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
    position: relative;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn { padding: 9px 14px; font-size: 14px; font-weight: 500; flex-shrink: 0; }
  .nav-btn.active { background: var(--blue); color: white; }

  .cal-day { min-height: 50px; padding: 3px 2px; }
  .cal-day .day-num { font-size: 12px; margin-bottom: 1px; text-align: center; }
  .cal-day .ev-dot,
  .cal-day .visit-dot,
  .cal-day .birthday-dot {
    font-size: 0 !important; padding: 0 !important; border-left: none !important;
    width: 7px; height: 7px;
    margin: 1px auto !important; display: block;
    line-height: 0;
  }
  .cal-day .ev-dot { border-radius: 2px; }      /* 일정 = 사각형 */
  .cal-day .visit-dot { border-radius: 50%; }   /* 방문 = 원형 */
  .cal-day .birthday-dot { background: #F59E0B; transform: rotate(45deg); border-radius: 1px; }   /* 생일 = 마름모 */
  .cal-day-hdr { font-size: 12px; padding: 4px 0 6px; }
  .cal-month { font-size: 16px; min-width: 110px; }
  .cal-nav button { width: 30px; height: 30px; font-size: 13px; }

  .mobile-day-events { display: none; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--border); }
  .mobile-day-events.show { display: block; }
  .mobile-day-events-title { font-size: 14px; font-weight: 700; color: var(--blue); margin-bottom: 9px; }

  .section-title { font-size: 16px; }
  .ev-item { padding: 12px; margin-bottom: 8px; }
  .ev-title { font-size: 15px; }
  .ev-meta { font-size: 13px; }
  .ev-desc { font-size: 13px; }
  .empty-msg { font-size: 15px; padding: 11px 0; }

  .row-item { flex-wrap: wrap; gap: 9px; padding: 13px 0; }
  .row-item button.btn.sm { width: auto; }
  .inst-name { font-size: 16px; }
  .inst-sub { font-size: 14px; }
  .inst-info { width: 100%; }

  .app-row { flex-direction: column; align-items: flex-start; gap: 7px; font-size: 15px; }
  .app-row .btn-grp { width: 100%; }
  .admin-row { padding: 13px 0; font-size: 15px; }

  .form-group input, .form-group select, .form-group textarea { padding: 13px 14px; font-size: 16px; }
  .form-group label { font-size: 13px; margin-bottom: 7px; }
  .multi-row input { padding: 11px 13px; font-size: 16px; }
  .multi-row span { font-size: 14px; }
  .multi-input-group label { font-size: 13px; }

  .day-grid { grid-template-columns: 65px repeat(2, 1fr); }
  .day-label { font-size: 14px; padding: 7px 5px; }
  .day-header { font-size: 13px; }
  .day-check input[type="checkbox"] { width: 20px; height: 20px; }

  .search-panel { padding: 13px; }
  .search-panel .search-row { gap: 7px; }
  .search-panel input, .search-panel select { font-size: 16px; min-width: 100%; }

  .btn { padding: 11px 16px; font-size: 15px; }
  .btn.sm { padding: 8px 12px; font-size: 13px; }
  .btn.full { padding: 14px; font-size: 16px; }

  .notice-card { padding: 13px 14px; }
  .notice-title { font-size: 15px; }
  .notice-meta { font-size: 13px; gap: 7px; }
  .notice-content { padding: 14px; font-size: 14px; }
  .priority-badge { font-size: 13px; padding: 3px 11px; }

  .comment-form textarea { font-size: 16px; min-height: 78px; }
  .comment-item { font-size: 15px; }
  .comment-author { font-size: 14px; }
  .comment-head { font-size: 13px; }
  .comment-body { font-size: 14px; }

  .profile-row { padding: 8px 0; font-size: 14px; gap: 9px; }
  .profile-row .lbl { min-width: 80px; font-size: 13px; }
  .profile-section-title { font-size: 13px; }

  .badge { font-size: 13px; padding: 3px 11px; }
  .info-box { font-size: 14px; padding: 12px 15px; }

  .modal-footer { flex-direction: column-reverse; gap: 7px; margin-top: 15px; }
  .modal-footer .btn { width: 100%; }
  .footer-credit { font-size: 12px; padding: 15px; }
  .toast { max-width: calc(100vw - 32px); white-space: normal; text-align: center; font-size: 15px; padding: 12px 20px; }
  .card-header { gap: 9px; flex-wrap: wrap; }
  .card-header .btn.sm { white-space: nowrap; }

  .manual-section h4 { font-size: 15px; }
  .manual-section h5 { font-size: 14px; }
  .manual-section p, .manual-section li { font-size: 14px; line-height: 1.85; }
  .manual-section .note,
  .manual-section .warn,
  .manual-section .danger { font-size: 14px; }
  .manual-toc a { font-size: 14px; }

  .login-logo h1 { font-size: 25px; }
  .login-logo .sub { font-size: 13px; }
  .login-logo { margin-bottom: 0.85rem !important; }
  .login-logo .brand-mark { width: 48px !important; height: 48px !important; margin-bottom: 6px !important; }
  .login-logo .brand-mark svg { width: 26px !important; height: 26px !important; }
  .login-card { padding: 1.25rem 1.4rem !important; }
  .login-card .form-group { margin-bottom: 0.7rem; }
  .login-card .info-box { padding: 9px 12px !important; }
  #loginScreen { padding: 0.6rem 0.5rem; }
  .login-wrap { max-width: 100%; }
  .login-card { padding: 1.1rem 1.05rem; }
  .login-logo h1 { font-size: 22px; }
  .login-logo .brand-mark { width: 54px; height: 54px; }
  .login-logo .brand-mark svg { width: 30px; height: 30px; }
  .login-credit { margin-top: 10px !important; }
  .tab { font-size: 15px; padding: 10px; }

  .err-msg { font-size: 14px; }
  .err-msg.info, .err-msg.success, .err-msg.warn { font-size: 14px; padding: 13px 15px; }
}

@media (max-width: 380px) {
  .content { padding: 10px; }
  .topbar .title small { display: none; }
  .nav-btn { padding: 8px 12px; font-size: 13px; }
  .day-grid { grid-template-columns: 55px repeat(2, 1fr); }
  .day-label { font-size: 13px; }
}

@media (min-width: 601px) {
  .mobile-day-events { display: none !important; }
}

/* ── Connection status / loading ── */
.conn-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; padding: 3px 8px; border-radius: 20px;
  font-weight: 500; background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
}
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: #ddd; flex-shrink: 0; transition: width 0.3s, height 0.3s; }
.conn-status.online .conn-dot {
  width: 10px; height: 10px;
  background: #5BD25B;
  animation: onlinePulse 1.4s ease-in-out infinite;
}
.conn-status.offline .conn-dot { background: #FF6B6B; }
.conn-status.connecting .conn-dot { background: #FFC857; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes onlinePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(91,210,91, 0.85), 0 0 6px #5BD25B;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 9px rgba(91,210,91, 0), 0 0 16px #5BD25B;
    transform: scale(1.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(91,210,91, 0), 0 0 6px #5BD25B;
    transform: scale(1);
  }
}

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.92);
  display: none; align-items: center; justify-content: center;
  z-index: 9999; backdrop-filter: blur(2px);
}
.loading-overlay.show { display: flex; }
.loading-content { text-align: center; color: var(--text); }
.loading-spinner {
  width: 40px; height: 40px; margin: 0 auto 14px;
  border: 3px solid var(--blue-light);
  border-top-color: var(--blue); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 13px; color: var(--text-sub); font-weight: 500; }

.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--text); color: white;
  padding: 10px 18px; border-radius: 24px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0; transition: opacity 0.25s, bottom 0.25s;
  pointer-events: none; z-index: 10000;
  max-width: 90%; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.toast.show { opacity: 1; bottom: 36px; }
.toast.error { background: var(--red); }
.toast.success { background: var(--green); }

.priority-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 4px;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.priority-normal  { background: var(--blue-light);  color: var(--blue); }
.priority-important { background: var(--amber-light); color: var(--amber); }
.priority-urgent  { background: var(--red); color: white;
                    animation: urgentPulse 1.8s ease-in-out infinite; }
@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(163, 45, 45, 0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(163, 45, 45, 0); }
}

.notice-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  padding: 12px 14px; margin-bottom: 10px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.12s;
}
.notice-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
  transform: translateY(-1px);
  border-color: var(--blue);
}
.notice-card.priority-urgent-border  { border-left-color: var(--red); }
.notice-card.priority-important-border { border-left-color: var(--amber); }
.notice-card.priority-normal-border  { border-left-color: var(--blue); }

.notice-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.notice-title { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; }
.notice-meta { font-size: 11px; color: var(--text-sub); display: flex; gap: 10px; flex-wrap: wrap; }
.notice-preview { font-size: 12px; color: var(--text-hint); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.notice-content {
  font-size: 13px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg); padding: 14px;
  border-radius: var(--radius-sm); margin-bottom: 14px;
}

.comment-list { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.comment-item { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.comment-item:last-child { border-bottom: none; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font-size: 11px; color: var(--text-sub); }
.comment-author { font-weight: 700; color: var(--text); font-size: 12px; }
.comment-body { white-space: pre-wrap; word-break: break-word; }
.comment-actions { margin-left: auto; display: flex; gap: 4px; }
.comment-actions button {
  padding: 1px 6px; font-size: 10px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 3px; cursor: pointer; color: var(--text-sub);
}
.comment-actions button:hover { color: var(--red); border-color: var(--red); }
.comment-form { display: flex; gap: 6px; margin-top: 10px; }
.comment-form textarea {
  flex: 1; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 13px; font-family: inherit;
  outline: none; resize: vertical; min-height: 60px;
}
.comment-form textarea:focus { border-color: var(--blue); }

/* ─── 본문 줄바꿈 보존 (textarea 입력 그대로 표시) ─── */
#ndContent,
#edDesc,
#iemDesc {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ─────────────────────────────────────────────────
   📄 강사 이력서 (A4 1장) — 화면 미리보기 + 인쇄 공통
   ───────────────────────────────────────────────── */
.resume-sheet {
  background: #fff;
  color: #111;
  width: 210mm;
  min-height: 297mm;
  max-width: 100%;
  margin: 0 auto;
  padding: 14mm 14mm;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  font-size: 10.5px;
  line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Noto Sans KR', sans-serif;
}
.resume-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 3px solid #186E48; padding-bottom: 8px; margin-bottom: 12px;
}
.resume-title { font-size: 20px; font-weight: 800; color: #186E48; }
.resume-subtitle { font-size: 10.5px; color: #666; margin-top: 2px; }
.resume-meta { text-align: right; font-size: 10.5px; color: #555; }
.resume-section { margin-bottom: 10px; }
.resume-section-title {
  font-size: 11.5px; font-weight: 700; color: #186E48;
  border-bottom: 1px solid #C8E5D4; padding-bottom: 2px; margin-bottom: 5px;
}
.resume-table {
  width: 100%; border-collapse: collapse; font-size: 11px;
}
.resume-table th, .resume-table td {
  border: 1px solid #E5E7EB; padding: 5px 9px; vertical-align: top;
}
.resume-table th {
  background: #F0F8F4; color: #186E48; font-weight: 600;
  width: 80px; text-align: left; white-space: nowrap;
}
.resume-list {
  list-style: none; padding: 0; margin: 4px 0 0 0;
}
.resume-list li {
  padding: 3px 0 3px 14px; position: relative;
  border-bottom: 1px dashed #EEE;
}
.resume-list li::before {
  content: '·'; position: absolute; left: 4px; color: #186E48; font-weight: 700;
}
.resume-list li:last-child { border-bottom: none; }
.resume-empty { color: #999; font-size: 11px; padding: 4px 0; margin: 0; }
.resume-appeal {
  font-size: 11px; white-space: pre-wrap;
  background: #FAFBFC; border: 1px solid #EEE; border-radius: 4px;
  padding: 8px 10px; margin: 4px 0 0;
}
.resume-footer {
  margin-top: 18px; padding-top: 8px;
  border-top: 1px solid #E5E7EB;
  font-size: 9.5px; color: #888; text-align: center;
}

/* 모바일에서는 A4 폭 강제하지 않음 */
@media (max-width: 600px) {
  .resume-sheet { width: 100%; padding: 14px; min-height: auto; font-size: 10.5px; }
  .resume-title { font-size: 18px; }
  .resume-table th { width: 70px; }
}

/* ─── 인쇄용 스타일 (PDF 1장 출력 최적화) ─── */
@media print {
  /* 1) body 직계 자식 중 이력서 모달 외 모두 숨김 (.app, 다른 모달, 토스트 등 한 번에 처리) */
  body > *:not(#resumeModalBg) {
    display: none !important;
  }

  /* 2) 이력서 모달 컨테이너를 일반 흐름으로 변환 — fixed 해제로 빈 페이지 방지 */
  #resumeModalBg,
  #resumeModalBg.open {
    position: static !important;
    inset: auto !important;
    display: block !important;
    background: #fff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: auto !important;
  }
  #resumeModalBg .modal {
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  /* 3) 인쇄 불필요 요소 숨김 (모달 안의 헤더/버튼 등) */
  .no-print { display: none !important; }

  /* 4) resume-sheet 자체 — 1장에 맞춰 패딩 축소 */
  .resume-sheet {
    width: 100% !important;
    min-height: auto !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 8mm 10mm !important;
    margin: 0 !important;
    position: static !important;
    page-break-inside: avoid;
  }

  /* 5) body/html 기본 정리 — 빈 여백 제거 */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    height: auto !important;
  }

  @page { size: A4; margin: 0; }
}

/* 농장 카드 헤더 호버 효과 (접기/펴기 가능 강조) */
#orchardCard > div[onclick]:hover .orchard-arrow {
  color: #186E48;
}
#orchardCard > div[onclick]:hover {
  background: rgba(255,255,255,0.3);
  border-radius: 6px;
}

/* ⚙️ 관리자 상단 설정 톱니바퀴 버튼 */
.gear-btn {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 8px;
  width: 32px; height: 32px;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.3s, background 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.gear-btn:hover { background: rgba(255,255,255,0.32); transform: rotate(90deg); }
.gear-btn.active { background: #fff; transform: rotate(90deg); }
