/* =============================================================
   학원관리시스템 공통 CSS  |  css/academy.css
   라이트/다크 모드 · 반응형 · AOS 지원
   ============================================================= */

/* ── CSS 변수 (라이트 모드) ─────────────────────────────────── */
:root {
  --pm-primary:          #2563eb;
  --pm-primary-dark:     #1d4ed8;
  --pm-primary-light:    #dbeafe;
  --pm-primary-cont:     #bfdbfe;
  --pm-on-primary:       #ffffff;

  --pm-success:          #059669;
  --pm-success-light:    #d1fae5;
  --pm-warning:          #d97706;
  --pm-warning-light:    #fef3c7;
  --pm-error:            #dc2626;
  --pm-error-light:      #fee2e2;

  --pm-bg:               #f0f4ff;
  --pm-surface:          #ffffff;
  --pm-surface-low:      #f8faff;
  --pm-surface-cont:     #eef2ff;
  --pm-surface-high:     #e0e7ff;
  --pm-on-surface:       #1e293b;
  --pm-on-surface-2:     #475569;
  --pm-on-surface-3:     #94a3b8;
  --pm-outline:          #e2e8f0;
  --pm-outline-md:       #cbd5e1;

  --pm-sidebar-w:        240px;
  --pm-header-h:         62px;

  --pm-radius-sm:        6px;
  --pm-radius-md:        10px;
  --pm-radius-lg:        16px;
  --pm-radius-xl:        20px;
  --pm-radius-full:      9999px;

  --pm-shadow-sm:        0 1px 3px rgba(0,0,0,.07),0 1px 2px rgba(0,0,0,.05);
  --pm-shadow-md:        0 4px 14px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.05);
  --pm-shadow-lg:        0 10px 32px rgba(37,99,235,.13),0 4px 8px rgba(0,0,0,.06);

  --pm-transition:       0.22s cubic-bezier(.4,0,.2,1);
}

/* ── 다크 모드 ───────────────────────────────────────────────── */
html.dark {
  --pm-primary:          #60a5fa;
  --pm-primary-dark:     #93c5fd;
  --pm-primary-light:    #1e3a8a;
  --pm-primary-cont:     #1e3a8a;
  --pm-on-primary:       #1e3a8a;

  --pm-success:          #34d399;
  --pm-success-light:    #064e3b;
  --pm-warning:          #fbbf24;
  --pm-warning-light:    #78350f;
  --pm-error:            #f87171;
  --pm-error-light:      #7f1d1d;

  --pm-bg:               #0f172a;
  --pm-surface:          #1e293b;
  --pm-surface-low:      #1a2540;
  --pm-surface-cont:     #1e3050;
  --pm-surface-high:     #243460;
  --pm-on-surface:       #e2e8f0;
  --pm-on-surface-2:     #94a3b8;
  --pm-on-surface-3:     #64748b;
  --pm-outline:          #334155;
  --pm-outline-md:       #475569;

  --pm-shadow-sm:        0 1px 3px rgba(0,0,0,.3);
  --pm-shadow-md:        0 4px 14px rgba(0,0,0,.35);
  --pm-shadow-lg:        0 10px 32px rgba(0,0,0,.45);
}

/* ── 리셋 ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--pm-bg);
  color: var(--pm-on-surface);
  transition: background var(--pm-transition), color var(--pm-transition);
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* 스크롤바 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--pm-outline-md); border-radius: 10px; }

/* Material Symbols */
.material-symbols-outlined {
  font-size: 18px;
  vertical-align: middle;
  font-variation-settings: 'FILL' 0,'wght' 400,'GRAD' 0,'opsz' 24;
}

/* ── 레이아웃 ─────────────────────────────────────────────────── */
.pm-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--pm-header-h);
  background: var(--pm-surface);
  border-bottom: 1px solid var(--pm-outline);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  z-index: 200;
  box-shadow: var(--pm-shadow-sm);
  transition: background var(--pm-transition);
}
.pm-header-left  { display: flex; align-items: center; gap: 10px; }
.pm-header-center { flex: 1; display: flex; justify-content: center; }
.pm-header-right { display: flex; align-items: center; gap: 6px; }

.pm-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 17px; font-weight: 800; color: var(--pm-primary);
}
.pm-logo-icon {
  width: auto; height: 35px; border-radius: var(--pm-radius-md);
  background: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; line-height: 1;
}
.pm-logo-text { display: inline-block; }

.pm-header-date {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--pm-on-surface-2);
  background: var(--pm-surface-cont);
  padding: 5px 12px; border-radius: var(--pm-radius-full);
}
.pm-header-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; border-radius: var(--pm-radius-full);
  background: var(--pm-surface-cont);
}
.pm-header-username { font-size: 12px; font-weight: 600; }

.pm-notif-btn { position: relative; }
.pm-notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--pm-error); border-radius: 50%;
  border: 2px solid var(--pm-surface);
}

/* ── 알림 드롭다운 ── */
.pm-notif-wrap { position: relative; }
.pm-notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 290px; max-width: calc(100vw - 24px);
  background: var(--pm-surface);
  border: 1px solid var(--pm-outline);
  border-radius: var(--pm-radius-lg);
  box-shadow: var(--pm-shadow-lg);
  padding: 6px; z-index: 300; display: none;
}
.pm-notif-panel.open { display: block; }
.pm-notif-panel-header {
  font-size: 12px; font-weight: 700; color: var(--pm-on-surface-3);
  padding: 8px 10px 6px;
}
.pm-notif-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--pm-radius-md);
  text-decoration: none; color: var(--pm-on-surface);
  transition: background .15s;
}
.pm-notif-list-item:hover { background: var(--pm-surface-cont); }
.pm-notif-list-item .material-symbols-outlined { font-size: 22px; }
.pm-notif-list-text { flex: 1; min-width: 0; }
.pm-notif-list-title { font-size: 13px; font-weight: 700; }
.pm-notif-list-sub { font-size: 11px; color: var(--pm-on-surface-3); margin-top: 1px; }
.pm-notif-count {
  flex-shrink: 0; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pm-error); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: var(--pm-radius-full);
}
.pm-notif-empty {
  padding: 22px 10px; text-align: center;
  font-size: 12px; color: var(--pm-on-surface-3);
}

/* ── 사이드바 ─────────────────────────────────────────────────── */
.pm-sidebar {
  position: fixed; top: var(--pm-header-h); left: 0;
  width: var(--pm-sidebar-w);
  height: calc(100vh - var(--pm-header-h));
  background: var(--pm-surface);
  border-right: 1px solid var(--pm-outline);
  overflow-y: auto; overflow-x: hidden;
  z-index: 150;
  transition: transform var(--pm-transition), background var(--pm-transition);
  display: flex; flex-direction: column;
  padding-bottom: 20px;
}
.pm-sidebar.pm-collapsed { transform: translateX(-100%); }

.pm-sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.4); z-index: 140;
}
.pm-sidebar-overlay.pm-show { display: block; }

.pm-sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  background: var(--pm-surface-cont);
  margin: 12px 12px 4px;
  border-radius: var(--pm-radius-lg);
}
.pm-sidebar-profile-name { font-size: 13px; font-weight: 700; color: var(--pm-primary); }
.pm-sidebar-profile-role { font-size: 13px; color: var(--pm-on-surface-2); margin-top: 1px; }

.pm-sidebar-nav { flex: 1; padding: 4px 0; }

.pm-nav-section-title {
  padding: 14px 20px 4px;
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--pm-on-surface-3);
}
html.dark .pm-nav-section-title { color: #64748b; }

.pm-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  font-size: 13px; font-weight: 500;
  color: var(--pm-on-surface-2);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .18s;
  white-space: nowrap;
}
/* 다크모드: 기본 메뉴 글자 흰색 */
html.dark .pm-nav-item { color: #e2e8f0; }

.pm-nav-item:hover {
  background: var(--pm-surface-cont);
  color: var(--pm-primary);
}
html.dark .pm-nav-item:hover { color: #93c5fd; background: rgba(255,255,255,.06); }

.pm-nav-item.active {
  background: var(--pm-primary-light);
  color: var(--pm-primary);
  font-weight: 700;
  border-left-color: var(--pm-primary);
}
html.dark .pm-nav-item.active {
  background: rgba(96,165,250,.15);
  color: #93c5fd;
  border-left-color: #60a5fa;
}

/* 사이드바 프로필 롤 텍스트도 다크모드에서 밝게 */
html.dark .pm-sidebar-profile-role { color: #94a3b8; }

.pm-nav-badge {
  margin-left: auto;
  background: var(--pm-error); color: #fff;
  font-size: 13px; font-weight: 700;
  padding: 1px 6px; border-radius: var(--pm-radius-full);
  min-width: 18px; text-align: center;
}

.pm-sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--pm-outline);
  margin-top: auto;
}
.pm-sidebar-footer-info {
  font-size: 13px; color: var(--pm-on-surface-3); text-align: center;
}

/* ── 메인 레이아웃 ───────────────────────────────────────────── */
.pm-layout-wrapper {
  display: flex;
  padding-top: var(--pm-header-h);
  min-height: 100vh;
}
.pm-main {
  flex: 1;
  margin-left: var(--pm-sidebar-w);
  padding: 24px;
  transition: margin-left var(--pm-transition);
  min-width: 0;
}
.pm-main.pm-expanded { margin-left: 0; }

/* ── 페이지 헤더 ──────────────────────────────────────────────── */
.pm-page-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 22px;
}
.pm-page-title { font-size: 20px; font-weight: 800; color: var(--pm-primary); }
.pm-page-sub   { font-size: 13px; color: var(--pm-on-surface-2); margin-top: 2px; }

/* ── 카드 ─────────────────────────────────────────────────────── */
.pm-card {
  background: var(--pm-surface);
  border: 1px solid var(--pm-outline);
  border-radius: var(--pm-radius-xl);
  box-shadow: var(--pm-shadow-sm);
  overflow: hidden;
  transition: box-shadow .22s;
}
.pm-card:hover { box-shadow: var(--pm-shadow-md); }
.pm-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--pm-outline);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--pm-surface-low);
  gap: 8px;
}
.pm-card-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.pm-card-title .material-symbols-outlined { color: var(--pm-primary); }
.pm-card-body { padding: 18px; }

/* ── 통계 카드 ───────────────────────────────────────────────── */
.pm-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.pm-stat-card {
  background: var(--pm-surface);
  border: 1px solid var(--pm-outline);
  border-radius: var(--pm-radius-xl);
  padding: 16px 18px;
  box-shadow: var(--pm-shadow-sm);
  position: relative; overflow: hidden;
  transition: transform .22s, box-shadow .22s;
}
.pm-stat-card:hover { transform: translateY(-2px); box-shadow: var(--pm-shadow-md); }
.pm-stat-icon {
  width: 38px; height: 38px; border-radius: var(--pm-radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.pm-stat-icon .material-symbols-outlined { font-size: 20px; }
.pm-stat-value { font-size: 26px; font-weight: 800; color: var(--pm-primary); line-height: 1.1; }
.pm-stat-label { font-size: 12px; color: var(--pm-on-surface-2); margin-top: 2px; }
.pm-stat-deco  {
  position: absolute; right: -8px; bottom: -8px;
  font-size: 64px; opacity: .05; pointer-events: none;
}

/* ── 그리드 ───────────────────────────────────────────────────── */
.pm-dashboard-grid { display: grid; gap: 18px; }
.pm-grid-2   { grid-template-columns: repeat(2, 1fr); }
.pm-grid-3   { grid-template-columns: repeat(3, 1fr); }
.pm-grid-2-1 { grid-template-columns: 2fr 1fr; }
.pm-grid-1-2 { grid-template-columns: 1fr 2fr; }
@media (max-width: 1280px) { .pm-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) {
  .pm-grid-2, .pm-grid-2-1, .pm-grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px)  { .pm-grid-3 { grid-template-columns: 1fr; } }

/* ── 버튼 ─────────────────────────────────────────────────────── */
.pm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 8px 16px;
  border-radius: var(--pm-radius-md);
  font-weight: 600; font-size: 13px;
  cursor: pointer; border: none;
  transition: all .18s;
  white-space: nowrap; line-height: 1.4;
}
.pm-btn .material-symbols-outlined { font-size: 16px; }
.pm-btn-primary { background: var(--pm-primary); color: #fff; }
.pm-btn-primary:hover { background: var(--pm-primary-dark); box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.pm-btn-success { background: var(--pm-success); color: #fff; }
.pm-btn-success:hover { filter: brightness(1.08); }
.pm-btn-warning { background: var(--pm-warning); color: #fff; }
.pm-btn-warning:hover { filter: brightness(1.05); }
.pm-btn-danger  { background: var(--pm-error); color: #fff; }
.pm-btn-danger:hover { filter: brightness(1.08); }
.pm-btn-outline {
  background: transparent; color: var(--pm-primary);
  border: 1.5px solid var(--pm-primary);
}
.pm-btn-outline:hover { background: var(--pm-primary-light); }
.pm-btn-ghost {
  background: transparent; color: var(--pm-on-surface-2);
  border: 1.5px solid var(--pm-outline-md);
}
.pm-btn-ghost:hover { background: var(--pm-surface-cont); color: var(--pm-on-surface); }
.pm-btn-icon {
  padding: 7px; border-radius: var(--pm-radius-full);
  background: transparent; border: none;
  color: var(--pm-on-surface-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .18s, color .18s;
}
.pm-btn-icon:hover { background: var(--pm-surface-cont); color: var(--pm-primary); }
.pm-btn-icon .material-symbols-outlined { font-size: 20px; }
.pm-btn-sm  { padding: 5px 12px; font-size: 12px; }
.pm-btn-xs  { padding: 3px 8px;  font-size: 13px; border-radius: var(--pm-radius-sm); }
.pm-btn-sm .material-symbols-outlined,
.pm-btn-xs .material-symbols-outlined { font-size: 14px; }
.pm-w-full { width: 100%; }

/* ── 태그/배지 ───────────────────────────────────────────────── */
.pm-tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: var(--pm-radius-full);
  font-size: 13px; font-weight: 700; line-height: 1.5;
  white-space: nowrap;
}
.pm-tag-primary { background: var(--pm-primary-light); color: var(--pm-primary); }
.pm-tag-success { background: var(--pm-success-light); color: var(--pm-success); }
.pm-tag-warning { background: var(--pm-warning-light); color: var(--pm-warning); }
.pm-tag-error   { background: var(--pm-error-light);   color: var(--pm-error); }
.pm-tag-gray    { background: var(--pm-surface-cont);  color: var(--pm-on-surface-2); }
html.dark .pm-tag-primary { background: var(--pm-primary-cont); color: var(--pm-primary); }
html.dark .pm-tag-success { background: var(--pm-success-light); }
html.dark .pm-tag-warning { background: var(--pm-warning-light); }
html.dark .pm-tag-error   { background: var(--pm-error-light); }

/* ── 폼 ───────────────────────────────────────────────────────── */
.pm-form-group  { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.pm-form-label  { font-size: 12px; font-weight: 600; color: var(--pm-on-surface-2); }
.pm-form-label em { color: var(--pm-error); font-style: normal; margin-left: 2px; }
.pm-form-control {
  width: 100%; padding: 8px 11px;
  border-radius: var(--pm-radius-md);
  border: 1.5px solid var(--pm-outline-md);
  background: var(--pm-surface);
  color: var(--pm-on-surface);
  font-size: 13px;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.pm-form-control:focus {
  border-color: var(--pm-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.pm-form-control::placeholder { color: var(--pm-on-surface-3); }
textarea.pm-form-control { resize: vertical; min-height: 80px; }
.pm-form-help { display:block; margin-top:5px; color:var(--pm-on-surface-3); font-size:12px; line-height:1.5; }

/* 공통 체크박스: 기본 브라우저 체크박스보다 크고 선명하게 */
.pm-layout-wrapper input[type="checkbox"]:not(.selec_chk),
.pm-modal-panel input[type="checkbox"]:not(.selec_chk),
.pm-mobile-menu input[type="checkbox"]:not(.selec_chk) {
  appearance:none; -webkit-appearance:none;
  width:22px; height:22px; min-width:22px;
  margin:0; border:2px solid var(--pm-outline-md);
  border-radius:6px; background:var(--pm-surface);
  display:inline-grid; place-content:center;
  vertical-align:middle; cursor:pointer;
  transition:border-color .15s, background .15s, box-shadow .15s;
}
.pm-layout-wrapper input[type="checkbox"]:not(.selec_chk)::before,
.pm-modal-panel input[type="checkbox"]:not(.selec_chk)::before,
.pm-mobile-menu input[type="checkbox"]:not(.selec_chk)::before {
  content:""; width:10px; height:6px;
  border-left:2px solid #fff; border-bottom:2px solid #fff;
  transform:rotate(-45deg) scale(0); transform-origin:center;
  transition:transform .12s ease;
}
.pm-layout-wrapper input[type="checkbox"]:not(.selec_chk):checked,
.pm-modal-panel input[type="checkbox"]:not(.selec_chk):checked,
.pm-mobile-menu input[type="checkbox"]:not(.selec_chk):checked {
  border-color:var(--pm-primary); background:var(--pm-primary);
}
.pm-layout-wrapper input[type="checkbox"]:not(.selec_chk):checked::before,
.pm-modal-panel input[type="checkbox"]:not(.selec_chk):checked::before,
.pm-mobile-menu input[type="checkbox"]:not(.selec_chk):checked::before { transform:rotate(-45deg) scale(1); }
.pm-layout-wrapper input[type="checkbox"]:not(.selec_chk):focus-visible,
.pm-modal-panel input[type="checkbox"]:not(.selec_chk):focus-visible,
.pm-mobile-menu input[type="checkbox"]:not(.selec_chk):focus-visible {
  outline:none; box-shadow:0 0 0 3px var(--pm-primary-light);
}
.pm-layout-wrapper input[type="checkbox"]:not(.selec_chk):disabled,
.pm-modal-panel input[type="checkbox"]:not(.selec_chk):disabled { opacity:.45; cursor:not-allowed; }

/* 날짜 입력 필드(.pm-datepicker) 오른쪽 달력 아이콘 */
.pm-datepicker {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='3'/><path d='M3 9h18M8 2v4M16 2v4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  padding-right: 38px;
  cursor: pointer;
}
html.dark .pm-datepicker {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='3'/><path d='M3 9h18M8 2v4M16 2v4'/></svg>");
}
.pm-form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pm-form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) { .pm-form-row, .pm-form-row-3 { grid-template-columns: 1fr; } }

.pm-check-group { display: flex; gap: 16px; flex-wrap: wrap; }
.pm-check-item  { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }

/* 필터바 */
.pm-filter-bar {
  background: var(--pm-surface);
  border: 1px solid var(--pm-outline);
  border-radius: var(--pm-radius-xl);
  padding: 12px 18px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 18px;
  box-shadow: var(--pm-shadow-sm);
}
.pm-filter-label { font-size: 12px; font-weight: 600; color: var(--pm-on-surface-2); white-space: nowrap; }
.pm-filter-date  { width: 130px; }

/* 검색 */
.pm-search-wrap  { position: relative; }
.pm-search-wrap input { padding-left: 32px; }
.pm-search-icon  {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--pm-on-surface-3); font-size: 15px; pointer-events: none;
}

/* ── 테이블 ───────────────────────────────────────────────────── */
.pm-table-wrap { overflow-x: auto; }
.pm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pm-table thead tr { background: var(--pm-surface-cont); }
.pm-table th {
  padding: 10px 14px; text-align: left;
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  color: var(--pm-on-surface-2); white-space: nowrap;
  border-bottom: 2px solid var(--pm-outline-md);
  letter-spacing: .03em;
}
.pm-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--pm-outline);
  vertical-align: middle;
}
.pm-table tbody tr:hover { background: var(--pm-surface-low); }
.pm-table tbody tr:last-child td { border-bottom: none; }

/* ── 출결 버튼 (academy.css에서는 기본 스타일만, 나머지는 attendance.php) ── */
.pm-att-btn-group { display: flex; gap: 4px; flex-wrap: nowrap; }
.pm-att-btn {
  padding: 5px 12px; border-radius: var(--pm-radius-full);
  font-size: 12px; font-weight: 700; cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s; white-space: nowrap;
  user-select: none;
}

/* ── 모달 (오른쪽 슬라이드인) ──────────────────────────────── */
.pm-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.38);
  z-index: 900;
  opacity: 0; pointer-events: none;
  transition: opacity .28s;
}
.pm-modal-overlay.pm-open { opacity: 1; pointer-events: all; }

.pm-modal-panel {
  position: fixed; top: 0; right: -520px;
  width: 100%; max-width: 500px; height: 100%;
  background: var(--pm-surface);
  z-index: 901;
  overflow-y: auto;
  transition: right .32s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
}
.pm-modal-panel.pm-open { right: 0; }

.pm-modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--pm-outline);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--pm-surface-low);
  position: sticky; top: 0; z-index: 1;
}
.pm-modal-title { font-size: 16px; font-weight: 800; color: var(--pm-primary); }
.pm-modal-body  { padding: 22px; flex: 1; }
.pm-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--pm-outline);
  background: var(--pm-surface-low);
  display: flex; justify-content: flex-end; gap: 8px;
  position: sticky; bottom: 0; z-index: 1;
}

/* ── 토스트 ───────────────────────────────────────────────────── */
.pm-toast-container {
  position: fixed; top: 74px; right: 18px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.pm-toast {
  background: var(--pm-surface);
  border: 1px solid var(--pm-outline);
  border-left: 4px solid var(--pm-success);
  border-radius: var(--pm-radius-md);
  padding: 11px 15px;
  box-shadow: var(--pm-shadow-lg);
  min-width: 250px; max-width: 340px;
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 500;
  animation: pmToastIn .28s ease, pmToastOut .3s ease 3.4s forwards;
}
.pm-toast .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.pm-toast-error  { border-left-color: var(--pm-error); }
.pm-toast-warn   { border-left-color: var(--pm-warning); }
@keyframes pmToastIn  { from{transform:translateX(110%);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes pmToastOut { from{opacity:1} to{opacity:0;transform:translateX(110%)} }

/* ── 페이지네이션 ─────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; padding: 16px 0;
}
.page-btn {
  width: 32px; height: 32px; border-radius: var(--pm-radius-md);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--pm-outline-md);
  background: var(--pm-surface);
  color: var(--pm-on-surface-2);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  user-select: none;
}
.page-btn.active { background: var(--pm-primary); color: #fff; border-color: var(--pm-primary); }
.page-btn:hover:not(.active) { background: var(--pm-surface-cont); color: var(--pm-primary); }

/* ── 리스트 아이템 (과제/보강/진도 등) ──────────────────────── */
.pm-list-item {
  background: var(--pm-surface);
  border: 1px solid var(--pm-outline);
  border-radius: var(--pm-radius-lg);
  padding: 14px 18px;
  margin-bottom: 12px;
  transition: box-shadow .18s;
}
.pm-list-item:hover { box-shadow: var(--pm-shadow-md); }
.pm-list-item-meta { font-size: 12px; color: var(--pm-on-surface-2); margin-bottom: 5px; }
.pm-list-item-content {
  background: var(--pm-surface-low);
  border-radius: var(--pm-radius-md);
  padding: 9px 13px;
  font-size: 13px; color: var(--pm-on-surface);
  margin-top: 6px;
  border: 1px solid var(--pm-outline);
}

/* ── 학생 목록 (상담 등) ─────────────────────────────────────── */
.pm-student-list { border: 1px solid var(--pm-outline); border-radius: var(--pm-radius-lg); overflow: hidden; }
.pm-student-item {
  padding: 10px 15px;
  border-bottom: 1px solid var(--pm-outline);
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  transition: background .15s;
}
.pm-student-item:last-child { border-bottom: none; }
.pm-student-item:hover  { background: var(--pm-surface-cont); }
.pm-student-item.active { background: var(--pm-primary-light); }
html.dark .pm-student-item.active { background: var(--pm-primary-cont); }
.pm-student-name { font-weight: 600; font-size: 13px; }
.pm-student-meta { font-size: 13px; color: var(--pm-on-surface-2); margin-top: 1px; }

/* ── 스케줄 아이템 ───────────────────────────────────────────── */
.pm-schedule-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--pm-radius-md);
  background: var(--pm-surface-low);
  margin-bottom: 10px;
  cursor: pointer;
  transition: background .18s;
}
.pm-schedule-item:hover { background: var(--pm-surface-cont); }
.pm-schedule-time { text-align: center; min-width: 46px; }
.pm-schedule-time-start,
.pm-schedule-time-end { font-size: 13px; color: var(--pm-on-surface-2); }
.pm-schedule-time-bar { width: 2px; height: 18px; border-radius: 1px; margin: 3px auto; }
.pm-schedule-title { font-weight: 700; font-size: 13px; }
.pm-schedule-meta  { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* ── 출석률 프로그레스바 ─────────────────────────────────────── */
.pm-progress-bar {
  width: 100%; height: 8px;
  background: var(--pm-outline); border-radius: var(--pm-radius-full);
  overflow: hidden;
}
.pm-progress-fill {
  height: 100%; border-radius: var(--pm-radius-full);
  transition: width .5s ease;
}
.pm-progress-ok   { background: var(--pm-success); }
.pm-progress-warn { background: var(--pm-warning); }
.pm-progress-bad  { background: var(--pm-error); }

/* ── 아바타 ───────────────────────────────────────────────────── */
.pm-avatar {
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
  background: var(--pm-primary-light); color: var(--pm-primary);
}
.pm-avatar          { width: 32px; height: 32px; font-size: 13px; }
.pm-avatar-sm       { width: 26px; height: 26px; font-size: 13px; }
.pm-avatar-lg       { width: 42px; height: 42px; font-size: 17px; }
.pm-avatar-primary  { background: var(--pm-primary); color: #fff; }
.pm-avatar-success  { background: var(--pm-success); color: #fff; }
.pm-avatar-error    { background: var(--pm-error);   color: #fff; }

/* ── 분할 레이아웃 (상담/출결 등) ───────────────────────────── */
.pm-split-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .pm-split-layout { grid-template-columns: 1fr; } }

/* ── 빈 상태 ─────────────────────────────────────────────────── */
.pm-empty-state {
  padding: 36px; text-align: center; color: var(--pm-on-surface-3);
}
.pm-empty-state .material-symbols-outlined { font-size: 44px; display: block; margin-bottom: 8px; opacity: .5; }

/* ── 구분선 ───────────────────────────────────────────────────── */
.pm-divider { border: none; border-top: 1px solid var(--pm-outline); margin: 16px 0; }

/* ── 유틸 ─────────────────────────────────────────────────────── */
.pm-flex            { display: flex; }
.pm-flex-col        { flex-direction: column; }
.pm-items-center    { align-items: center; }
.pm-justify-between { justify-content: space-between; }
.pm-justify-end     { justify-content: flex-end; }
.pm-wrap            { flex-wrap: wrap; }
.pm-gap-4  { gap: 4px;  }
.pm-gap-6  { gap: 6px;  }
.pm-gap-8  { gap: 8px;  }
.pm-gap-10 { gap: 10px; }
.pm-gap-12 { gap: 12px; }
.pm-gap-16 { gap: 16px; }
.pm-mt-4   { margin-top: 4px; }
.pm-mt-8   { margin-top: 8px; }
.pm-mt-12  { margin-top: 12px; }
.pm-mt-16  { margin-top: 16px; }
.pm-mt-20  { margin-top: 20px; }
.pm-mb-4   { margin-bottom: 4px; }
.pm-mb-8   { margin-bottom: 8px; }
.pm-mb-12  { margin-bottom: 12px; }
.pm-mb-16  { margin-bottom: 16px; }
.pm-text-primary { color: var(--pm-primary); }
.pm-text-success { color: var(--pm-success); }
.pm-text-warning { color: var(--pm-warning); }
.pm-text-error   { color: var(--pm-error); }
.pm-text-muted   { color: var(--pm-on-surface-2); }
.pm-text-xs      { font-size: 13px; }
.pm-text-sm      { font-size: 12px; }
.pm-font-bold    { font-weight: 700; }

/* ── jQuery UI Datepicker 오버라이드 ────────────────────────── */
/* ── jQuery UI Datepicker ───────────────────────────────────── */
.ui-datepicker {
  background: var(--pm-surface)          !important;
  border: 1.5px solid var(--pm-outline-md) !important;
  border-radius: var(--pm-radius-lg)     !important;
  box-shadow: var(--pm-shadow-lg)        !important;
  font-family: 'Noto Sans KR', sans-serif !important;
  font-size: 13px !important;
  z-index: 9999   !important;
  padding: 8px    !important;
  min-width: 260px !important;
}

/* ── 헤더: 연한 회색 배경 ── */
.ui-datepicker .ui-datepicker-header {
  background: var(--pm-surface-cont) !important;
  border: 1.5px solid var(--pm-outline) !important;
  border-radius: var(--pm-radius-md)  !important;
  color: var(--pm-on-surface)         !important;
  padding: 8px 10px                   !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* ── 타이틀 (년/월 셀렉트 감싸는 영역) ── */
.ui-datepicker .ui-datepicker-title {
  color: var(--pm-on-surface) !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  display: flex;
  align-items: center;
  gap: 6px;
  order: 2;
}
.ui-datepicker .ui-datepicker-title .ui-datepicker-year { order: 1; margin: 0; }
.ui-datepicker .ui-datepicker-title .ui-datepicker-month { order: 2; margin: 0; }

/* ── 년/월 셀렉트박스 ── */
.ui-datepicker .ui-datepicker-month,
.ui-datepicker .ui-datepicker-year {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: var(--pm-surface)            !important;
  border: 1px solid var(--pm-outline-md)   !important;
  border-radius: 6px                       !important;
  color: var(--pm-on-surface)              !important;
  font-size: 13px                          !important;
  font-weight: 700                         !important;
  font-family: 'Noto Sans KR', sans-serif  !important;
  padding: 4px 22px 4px 8px               !important;
  cursor: pointer;
  outline: none;
  transition: all .18s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat            !important;
  background-position: right 4px center  !important;
}
.ui-datepicker .ui-datepicker-month { width: 58px  !important; }
.ui-datepicker .ui-datepicker-year  { width: 72px  !important; }
.ui-datepicker .ui-datepicker-month:hover,
.ui-datepicker .ui-datepicker-year:hover {
  border-color: var(--pm-primary) !important;
  background-color: var(--pm-primary-light) !important;
}
.ui-datepicker .ui-datepicker-month:focus,
.ui-datepicker .ui-datepicker-year:focus {
  border-color: var(--pm-primary) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
}

/* ── 이전/다음 버튼 ── */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  cursor: pointer;
  top: 50% !important;
  transform: translateY(-50%);
  width: 26px  !important;
  height: 26px !important;
  border-radius: 6px !important;
  background: var(--pm-surface-high) !important;
  border: 1px solid var(--pm-outline) !important;
  transition: all .18s;
  position: absolute !important;
  box-shadow: none !important;
}
.ui-datepicker .ui-datepicker-prev { left: 4px !important; }
.ui-datepicker .ui-datepicker-next { right: 4px !important; }
.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover {
  background: var(--pm-outline-md) !important;
  border-color: var(--pm-outline-md) !important;
}

/* 이전/다음 아이콘 */
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
  display: block !important;
  overflow: hidden !important;
  text-indent: -9999px !important;
  width: 100% !important;
  height: 100% !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 16px !important;
  margin: 0 !important;
  top: 0 !important;
  left: 0 !important;
  position: static !important;
}
.ui-datepicker .ui-datepicker-prev span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z'/%3E%3C/svg%3E") !important;
}
.ui-datepicker .ui-datepicker-next span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23475569'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") !important;
}
.ui-datepicker .ui-datepicker-prev:hover span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231e293b'%3E%3Cpath d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z'/%3E%3C/svg%3E") !important;
}
.ui-datepicker .ui-datepicker-next:hover span {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231e293b'%3E%3Cpath d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E") !important;
}

/* ── 요일 헤더 ── */
.ui-datepicker th {
  color: var(--pm-on-surface-2) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 6px 4px !important;
  text-align: center;
}

/* ── 날짜 셀 ── */
.ui-datepicker td { padding: 1px !important; }
.ui-datepicker td .ui-state-default {
  background: transparent !important;
  border: none !important;
  color: var(--pm-on-surface) !important;
  text-align: center !important;
  padding: 6px 5px !important;
  border-radius: var(--pm-radius-md) !important;
  font-size: 13px !important;
  transition: all .15s;
  display: block;
}
.ui-datepicker td .ui-state-default:hover {
  background: var(--pm-primary-light) !important;
  color: var(--pm-primary) !important;
}
.ui-datepicker td .ui-state-active {
  background: var(--pm-primary)       !important;
  color: #fff                         !important;
  font-weight: 700                    !important;
  border-radius: var(--pm-radius-md)  !important;
}
.ui-datepicker td .ui-state-highlight {
  background: var(--pm-primary-light) !important;
  color: var(--pm-primary)            !important;
  font-weight: 700                    !important;
  border-radius: var(--pm-radius-md)  !important;
}
/* 일요일 빨강 */
.ui-datepicker td:first-child .ui-state-default { color: var(--pm-error) !important; }
/* 토요일 파랑 */
.ui-datepicker td:last-child .ui-state-default  { color: #3b82f6 !important; }

/* ── 다크모드 ── */
html.dark .ui-datepicker {
  background: var(--pm-surface) !important;
  border-color: var(--pm-outline) !important;
}
html.dark .ui-datepicker .ui-datepicker-header {
  background: var(--pm-surface-cont) !important;
  border-color: var(--pm-outline) !important;
}
html.dark .ui-datepicker .ui-datepicker-month,
html.dark .ui-datepicker .ui-datepicker-year {
  background: var(--pm-surface-low) !important;
  border-color: var(--pm-outline) !important;
  color: var(--pm-on-surface) !important;
}
html.dark .ui-datepicker .ui-datepicker-prev,
html.dark .ui-datepicker .ui-datepicker-next {
  background: var(--pm-surface-low) !important;
  border-color: var(--pm-outline) !important;
}
html.dark .ui-datepicker td .ui-state-default {
  color: var(--pm-on-surface) !important;
}
html.dark .ui-datepicker th {
  color: var(--pm-on-surface-2) !important;
}


/* 월 선택 필드: 입력 모양은 .pm-datepicker를 그대로 재사용하고 일자 표만 숨긴다. */
.ui-datepicker.pm-monthpicker-panel .ui-datepicker-calendar { display: none !important; }
.ui-datepicker.pm-monthpicker-panel .ui-datepicker-buttonpane {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 0 !important;
  padding: 8px 0 0 !important;
  border-top: 1px solid var(--pm-outline) !important;
}
.ui-datepicker.pm-monthpicker-panel .ui-datepicker-buttonpane button {
  margin: 0 !important;
  padding: 6px 12px !important;
  border: 1px solid var(--pm-outline-md) !important;
  border-radius: var(--pm-radius-md) !important;
  background: var(--pm-surface) !important;
  color: var(--pm-on-surface) !important;
  font-family: 'Noto Sans KR', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer;
}
.ui-datepicker.pm-monthpicker-panel .ui-datepicker-buttonpane button:hover {
  border-color: var(--pm-primary) !important;
  background: var(--pm-primary-light) !important;
  color: var(--pm-primary) !important;
}
html.dark .ui-datepicker.pm-monthpicker-panel .ui-datepicker-buttonpane button {
  background: var(--pm-surface-low) !important;
  border-color: var(--pm-outline) !important;
  color: var(--pm-on-surface) !important;
}

/* ── FullCalendar 오버라이드 ─────────────────────────────────── */
.fc { font-family: 'Noto Sans KR', sans-serif; font-size: 13px; }
.fc-theme-standard td,
.fc-theme-standard th       { border-color: var(--pm-outline); }
.fc-daygrid-day-number      { color: var(--pm-on-surface); font-size: 12px; }
.fc-col-header-cell-cushion { color: var(--pm-on-surface-2); font-weight: 700; font-size: 12px; }
.fc .fc-toolbar-title       { font-size: 15px; font-weight: 800; color: var(--pm-primary); }
.fc .fc-button-primary      { background: var(--pm-primary) !important; border-color: var(--pm-primary) !important; font-size: 12px; font-weight: 600; }
.fc .fc-button-primary:not(:disabled):hover { background: var(--pm-primary-dark) !important; }
html.dark .fc-daygrid-day   { background: var(--pm-surface); }
html.dark .fc-col-header    { background: var(--pm-surface-cont); }
html.dark .fc-scrollgrid    { border-color: var(--pm-outline); }

/* ── 반응형 ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pm-sidebar { transform: translateX(-100%); }
  .pm-sidebar.pm-mobile-open { transform: translateX(0); }
  .pm-main { margin-left: 0 !important; }
  .hide-mobile { display: none !important; }
  .pm-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .pm-modal-panel { max-width: 100%; right: -100%; }
  .pm-page-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .pm-main { padding: 14px; }
  .pm-stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pm-stat-value { font-size: 22px; }
}

/* ── 다크모드 헤더/사이드바 추가 보정 ────────────────────────── */
html.dark .pm-header-date     { color: #cbd5e1; }
html.dark .pm-header-username { color: #e2e8f0; }
html.dark .pm-btn-icon        { color: #cbd5e1; }
html.dark .pm-btn-icon:hover  { background: rgba(255,255,255,.08); color: #93c5fd; }
html.dark .pm-sidebar-footer-info { color: #64748b; }

/* ── 사이드바 관리자 기어 아이콘 ─────────────────────────────── */
.pm-sidebar-profile-role {
  display: flex; align-items: center; gap: 5px;
}
.pm-admin-gear-btn {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--pm-on-surface-3);
  border-radius: var(--pm-radius-full);
  padding: 1px;
  transition: color .18s, transform .3s;
  line-height: 1;
}
.pm-admin-gear-btn .material-symbols-outlined { font-size: 14px; }
.pm-admin-gear-btn:hover {
  color: var(--pm-primary);
  transform: rotate(60deg);
}
html.dark .pm-admin-gear-btn       { color: #64748b; }
html.dark .pm-admin-gear-btn:hover { color: #93c5fd; }


/* =====================================================
   파일 첨부 공통 스타일
   ===================================================== */

/* 드롭존 */
.pm-file-dropzone {
    border: 2px dashed var(--pm-outline-md);
    border-radius: var(--pm-radius-lg);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--pm-surface-low);
    color: var(--pm-on-surface-2);
    margin-bottom: 12px;
}
.pm-file-dropzone:hover,
.pm-file-dropzone.dragover {
    border-color: var(--pm-primary);
    background: var(--pm-primary-light);
    color: var(--pm-primary);
}
.pm-file-dropzone.uploading {
    opacity: .6;
    pointer-events: none;
}

/* 파일 아이템 */
.pm-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--pm-outline);
    border-radius: var(--pm-radius-md);
    margin-bottom: 6px;
    background: var(--pm-surface);
    transition: background .15s;
}
.pm-file-item:hover { background: var(--pm-surface-low); }

/* 이미지 썸네일 */
.pm-file-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--pm-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    cursor: zoom-in;
}
.pm-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 파일 정보 */
.pm-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pm-file-name {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--pm-on-surface);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-file-name:hover { color: var(--pm-primary); }
.pm-file-name {
    border: 0;
    background: none;
    padding: 0;
    text-align: left;
    cursor: pointer;
}
.pm-file-name .material-symbols-outlined { font-size: 16px; flex-shrink: 0; }
.pm-file-visibility {
    min-width: 112px;
    height: 34px;
    border: 1px solid var(--pm-outline);
    border-radius: var(--pm-radius-sm);
    background: var(--pm-surface);
    color: var(--pm-on-surface);
    padding: 0 8px;
    font-size: 12px;
}
.pm-file-visibility:disabled { opacity: .6; cursor: wait; }
.pm-file-delete-icon { font-size: 16px; color: var(--pm-error); }
@media (max-width: 640px) {
    .pm-file-item { align-items: flex-start; flex-wrap: wrap; }
    .pm-file-info { flex-basis: calc(100% - 70px); }
    .pm-file-visibility { margin-left: 58px; flex: 1; }
}
.pm-file-size {
    font-size: 12px;
    color: var(--pm-on-surface-3);
}

/* 이미지 미리보기 오버레이 */
.pm-file-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* ── 모달 섹션 라벨 ── */
.pm-section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--pm-on-surface-2);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--pm-outline);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}


/* =====================================================
   배포완결판: 모바일 뷰포트·안전영역 안정화
   ===================================================== */
@supports (height: 100dvh) {
  .pm-sidebar { height: calc(100dvh - var(--pm-header-h)); }
  .pm-modal-panel { min-height: 100dvh; max-height: 100dvh; }
}
.pm-modal-footer,
.pm-sidebar-footer {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.pm-header {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}
@media (max-width: 768px) {
  .pm-main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .pm-modal-panel {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }
  input, select, textarea { font-size: 16px; }
  .pm-btn, .pm-btn-icon { min-height: 44px; }
  .pm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ===== merged saas-enhance.css (v4 single CSS load) ===== */
/* =============================================================
 * 학원관리시스템 SaaS — 보강 스타일
 * 위치: themes/academy/css/saas-enhance.css
 * 로드: head.php 에서 academy.css 다음에 <link> 추가 (마지막에 로드되어야 오버라이드됨)
 *
 * 목적:
 *  1) 글자크기 표준화 — PC 16px / 모바일 14px (11px 이하 금지)
 *  2) 다크모드 회색글씨 가독성 개선 (안 보이는 현상 제거)
 *  3) 비주얼 품질 향상 (그림자·모달·뱃지·카드 다듬기)
 * ============================================================= */

/* ------------------------------------------------------------
 * 1) 글자크기 표준 — PC 16 / 모바일 14
 * ------------------------------------------------------------ */
:root {
  --pm-fs-base: 16px;    /* PC 본문 */
  --pm-fs-sm:   14px;    /* PC 작은 글씨 (최소) */
  --pm-fs-lg:   18px;
}
html, body { font-size: var(--pm-fs-base); }

/* 본문 텍스트 요소 기본 16px 보장 */
.pm-table, .pm-table td, .pm-table th,
.pm-form-control, .pm-btn, .pm-card, .pm-modal-body,
.pm-page-desc, .pm-stat-label, p, label, select, input, textarea, a {
  font-size: var(--pm-fs-base);
}

/* 부가정보(메타/작은뱃지)는 14px 하한 — 기존 11~13px 상향 */
.pm-page-sub, .pm-notif-list-sub, .pm-sidebar-profile-role,
.pm-nav-section-title, .pm-stat-label, .cls-meta, .tm-mtab,
small, .pm-tag, .pm-badge, .sa-plan-badge, .sa-type-badge {
  font-size: var(--pm-fs-sm) !important;
}

/* 아주 작던 요소들 강제 하한 (11~13px → 14px) */
[style*="font-size:10px"], [style*="font-size:11px"],
[style*="font-size:12px"], [style*="font-size:13px"],
[style*="font-size: 10px"], [style*="font-size: 11px"],
[style*="font-size: 12px"], [style*="font-size: 13px"] {
  font-size: var(--pm-fs-sm) !important;
}

/* 제목류는 더 크게 유지 */
.pm-page-title { font-size: 22px; }
.pm-modal-title { font-size: 18px; }
.pm-card-title { font-size: 17px; }
.pm-stat-value { font-size: 26px; }

/* 모바일: 본문 14px */
@media (max-width: 768px) {
  :root { --pm-fs-base: 14px; --pm-fs-sm: 14px; }
  html, body { font-size: 14px; }
  .pm-page-title { font-size: 19px; }
  .pm-stat-value { font-size: 22px; }
  .pm-modal-title { font-size: 16px; }
}

/* ------------------------------------------------------------
 * 2) 다크모드 가독성 — 회색글씨가 배경에 묻히지 않게 밝게
 *    (기존 on-surface-2/3 이 다크에서 너무 어두웠음)
 * ------------------------------------------------------------ */
html.dark {
  --pm-on-surface:    #f1f5f9;   /* 본문: 더 밝게 */
  --pm-on-surface-2:  #cbd5e1;   /* 보조: #94a3b8 → 밝게 (핵심 개선) */
  --pm-on-surface-3:  #a5b4c3;   /* 흐린텍스트: #64748b → 밝게 (핵심 개선) */
}

/* 다크모드에서 인라인 회색 하드코딩 색상들 밝게 교정 */
html.dark [style*="color:#94a3b8"],
html.dark [style*="color: #94a3b8"],
html.dark [style*="color:#64748b"],
html.dark [style*="color: #64748b"],
html.dark [style*="color:#9ca3af"],
html.dark [style*="color: #9ca3af"] {
  color: #cbd5e1 !important;
}

/* 다크모드 테이블/카드 경계 대비 향상 */
html.dark .pm-table th { color: #e2e8f0; }
html.dark .pm-table td { color: #f1f5f9; }
html.dark .pm-card,
html.dark .cls-card,
html.dark .cls-pool,
html.dark .jn-result,
html.dark .ts-card { border-color: rgba(255,255,255,.12); }

/* 다크모드 뱃지 색 대비 (밝은 배경 뱃지의 글자가 묻히지 않게) */
html.dark .pm-tag,
html.dark .sa-plan-badge,
html.dark .sa-type-badge { filter: brightness(1.12); }

/* 다크모드 라이트배경 뱃지(성공/정보/경고) 텍스트 진하게 유지 */
html.dark .pm-tag-success { background:#14532d; color:#86efac; }
html.dark .pm-tag-info    { background:#0c4a6e; color:#7dd3fc; }
html.dark .pm-tag-warning { background:#78350f; color:#fcd34d; }
html.dark .pm-tag-primary { background:#1e3a8a; color:#93c5fd; }

/* ------------------------------------------------------------
 * 3) 비주얼 품질 향상
 * ------------------------------------------------------------ */
/* 카드: 부드러운 그림자 + 호버 상승 */
.pm-card {
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .2s, transform .2s;
}
.pm-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
html.dark .pm-card { box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* 통계 카드: 아이콘 원형 배경 + 값 강조 */
.pm-stat-card {
  border-radius: 16px;
  padding: 18px;
  transition: transform .2s;
}
.pm-stat-card:hover { transform: translateY(-2px); }
.pm-stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.pm-stat-value { font-weight: 800; line-height: 1.1; }

/* 우측 모달: 그림자 강화 + 부드러운 슬라이드 */
.pm-modal-panel {
  box-shadow: -8px 0 32px rgba(0,0,0,.16);
  transition: right .28s cubic-bezier(.4,0,.2,1);
}
html.dark .pm-modal-panel { box-shadow: -8px 0 32px rgba(0,0,0,.5); }

/* 버튼: 미묘한 상승 + 그림자 */
.pm-btn-primary {
  box-shadow: 0 1px 2px rgba(37,99,235,.2);
  transition: transform .12s, box-shadow .2s, background .2s;
}
.pm-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(37,99,235,.3); }
.pm-btn-primary:active { transform: translateY(0); }

/* 뱃지: 알약형 + 적당한 여백 */
.pm-tag, .pm-badge {
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 700;
  line-height: 1.4;
}

/* 테이블: 행 호버 하이라이트 + 헤더 구분 */
.pm-table tbody tr { transition: background .12s; }
.pm-table tbody tr:hover { background: var(--pm-surface-low, rgba(0,0,0,.02)); }
html.dark .pm-table tbody tr:hover { background: rgba(255,255,255,.04); }
.pm-table th {
  font-weight: 700;
  border-bottom: 2px solid var(--pm-outline);
  padding-top: 12px; padding-bottom: 12px;
}

/* 입력 필드: 포커스 링 */
.pm-form-control {
  transition: border-color .15s, box-shadow .15s;
}
.pm-form-control:focus {
  border-color: var(--pm-primary);
  box-shadow: 0 0 0 3px var(--pm-primary-light);
  outline: none;
}

/* 프로그레스 바(수납률/제한): 부드러운 채움 */
.tm-rate-fill, .sa-limit-fill {
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* 페이지 헤더: 아래 여백/구분 */
.pm-page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px; padding-bottom: 4px;
}

/* 빈 상태(empty) 부드럽게 */
.pm-empty-state, [class*="empty"] { color: var(--pm-on-surface-3); }

/* 모바일: 카드 여백 축소, 가로 스크롤 테이블 */
@media (max-width: 768px) {
  .pm-card { padding: 14px; }
  .pm-stat-card { padding: 14px; }
  .pm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pm-page-header { flex-direction: column; align-items: stretch; gap: 10px; }
}

/* ===== Academy v4 two-row header / sticky navigation / mobile drawer ===== */
.pm-header-top{display:block;min-height:64px;height:auto;padding:0;position:relative;top:auto;left:auto;right:auto;z-index:910;background:var(--pm-surface);border-bottom:1px solid var(--pm-outline);box-shadow:none}
.pm-header-inner{width:calc(100% - 32px);max-width:1200px;min-height:64px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:20px}
.pm-brand-bar .pm-header-left{min-width:0;flex:1}.pm-brand-bar .pm-header-right{flex:0 0 auto}
.pm-menu-bar{position:sticky;top:0;z-index:1000;width:100%;background:var(--pm-surface);border-bottom:1px solid var(--pm-outline);box-shadow:0 3px 14px rgba(15,23,42,.08)}
.pm-menu-inner{width:calc(100% - 32px);max-width:1200px;height:56px;margin:0 auto;display:flex;align-items:stretch;overflow:visible}
.pm-top-nav{display:flex;align-items:stretch;gap:1px;width:100%;height:56px;min-width:0;overflow:visible}
.pm-top-menu-group{position:relative;display:flex;align-items:stretch}
.pm-top-menu-btn,.pm-top-menu-link{display:flex;align-items:center;gap:5px;border:0;background:transparent;color:var(--pm-on-surface);padding:0 10px;font:inherit;font-size:13px;font-weight:700;text-decoration:none;cursor:pointer;white-space:nowrap;border-bottom:3px solid transparent}
.pm-top-menu-btn:hover,.pm-top-menu-link:hover,.pm-top-menu-link.active,.pm-top-menu-btn.open{color:var(--pm-primary);background:var(--pm-primary-light);border-bottom-color:var(--pm-primary)}
.pm-top-menu-btn .material-symbols-outlined,.pm-top-menu-link .material-symbols-outlined{font-size:19px}.pm-menu-arrow{font-size:16px!important;transition:transform .15s}.pm-top-menu-btn.open .pm-menu-arrow{transform:rotate(180deg)}
.pm-top-dropdown{display:none;position:absolute;left:0;top:calc(100% - 1px);min-width:210px;padding:8px;background:var(--pm-surface);border:1px solid var(--pm-outline);border-radius:0 0 12px 12px;box-shadow:0 18px 44px rgba(15,23,42,.18);z-index:1010}.pm-top-dropdown.open{display:block}
.pm-top-dropdown-item{display:flex;padding:11px 13px;border-radius:8px;color:var(--pm-on-surface);font-size:14px;font-weight:600;text-decoration:none}.pm-top-dropdown-item:hover,.pm-top-dropdown-item.active{background:var(--pm-primary-light);color:var(--pm-primary)}
.pm-tenant-chip{display:flex;align-items:center;gap:5px;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pm-on-surface-2);text-decoration:none;font-size:13px;font-weight:700}
.pm-mobile-menu-toggle{display:none}.pm-mobile-menu-overlay{display:none;position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:1090}.pm-mobile-menu{position:fixed;top:0;right:-360px;width:min(88vw,340px);height:100vh;background:var(--pm-surface);z-index:1100;transition:right .22s;overflow:auto;box-shadow:-16px 0 45px rgba(15,23,42,.2)}.pm-mobile-menu.open{right:0}.pm-mobile-menu-overlay.open{display:block}.pm-mobile-menu-head{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid var(--pm-outline)}.pm-mobile-menu nav{padding:10px}.pm-mobile-menu .pm-top-menu-group{display:block}.pm-mobile-menu .pm-top-menu-btn,.pm-mobile-menu .pm-top-menu-link{width:100%;height:48px;justify-content:flex-start;border:0;border-radius:9px}.pm-mobile-menu .pm-menu-arrow{margin-left:auto}.pm-mobile-menu .pm-top-dropdown{position:static;box-shadow:none;border:0;border-left:2px solid var(--pm-outline);border-radius:0;margin-left:20px;padding:2px 0 5px 8px}.pm-mobile-menu .pm-top-dropdown-item{padding:10px}.pm-mobile-tenant{margin:12px;padding:14px;border-radius:10px;background:var(--pm-primary-light);font-size:12px;color:var(--pm-on-surface-2)}
.pm-layout-wrapper{margin-left:0!important;width:100%!important;padding-top:0!important}.pm-main{margin-left:auto!important;max-width:1200px;width:calc(100% - 32px);margin-right:auto!important;margin-top:0!important;padding:24px 0 60px!important}
.pm-footer{width:100%;border-top:1px solid var(--pm-outline);background:var(--pm-surface)}
.pm-footer-inner{width:calc(100% - 32px);max-width:1200px;min-height:58px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--pm-on-surface-3);font-size:12px}
.pm-modal-panel{position:fixed!important;top:0!important;right:-620px!important;left:auto!important;bottom:0!important;display:flex!important;width:min(92vw,560px)!important;max-width:560px!important;height:100vh!important;max-height:none!important;flex-direction:column!important;border-radius:18px 0 0 18px!important;transform:none!important;transition:right .22s ease!important;z-index:1201!important}.pm-modal-panel.pm-open{right:0!important}.pm-modal-body{overflow:auto;flex:1}.pm-modal-overlay{z-index:1200!important}
html.pm-modal-locked,body.pm-modal-locked{overflow:hidden!important;overscroll-behavior:none}
.pm-empty{text-align:center!important;padding:30px!important;color:var(--pm-on-surface-3)!important}
@media(max-width:1180px){.pm-menu-bar{display:none}.pm-header-top{position:sticky;top:0;z-index:1000;box-shadow:0 3px 14px rgba(15,23,42,.08)}.pm-top-nav{display:none}.pm-mobile-menu-toggle{display:inline-flex}.pm-header-inner{width:calc(100% - 20px)}.pm-logo-text{max-width:150px;overflow:hidden;text-overflow:ellipsis}.pm-main{width:calc(100% - 24px);padding-top:18px!important}}
@media(max-width:640px){.pm-modal-panel{width:100vw!important;max-width:none!important;border-radius:0!important}.pm-main{width:calc(100% - 20px)}.pm-header-user{display:none}.pm-footer-inner{width:calc(100% - 20px);min-height:52px;flex-direction:column;justify-content:center;align-items:flex-start;gap:2px}}
