/* =============================================================
   layout-test 공통 CSS 프레임워크
   — https://mail.freeitm.com/ 의 레이아웃/컬러/컴포넌트 스타일을 참고해
     top_bar / sidebar / sub-sidebar / main / sub-main / list-panel /
     editor-panel / preview-panel / cal-* 등 범용 레이아웃 클래스를 구성.
   ============================================================= */

:root {
  --clr-bg:            #f5f6f8;
  --clr-text:          #222222;
  --clr-text-sub:      #64748b;
  --clr-primary:       #26205a;
  --clr-primary-hover: #0042aa;
  --clr-border:        #e2e5ea;
  --clr-border-light:  #f1f5f9;
  --clr-surface:       #ffffff;
  --basic-svg-color:   #111827;

  --nav-active-bg:  #ebebeb;
  --nav-hover-bg:   #f1f5f9;

  --btn-primary-bg:     #263e0f;
  --btn-primary-text:   #ffffff;
  --btn-primary-hover:  #669c35;
  --btn-secondary-bg:   #e5e7eb;
  --btn-secondary-text: #374151;
  --btn-second-border:  #9ca3af;
  --btn-second-hover:   #d1d5db;
  --btn-cancel-bg:      #ffffff;
  --btn-cancel-text:    #555555;
  --btn-cancel-border:  #dddddd;
  --btn-cancel-hover:   #f5f5f5;
  --btn-danger-bg:      #ef4444;
  --btn-danger-text:    #ffffff;
  --btn-danger-hover:   #dc2626;

  --header-height: 52px;
  --header-bg:     #1e293b;
  --header-text:   #f1f5f9;
  --header-hover:  rgba(255,255,255,.08);

  --sidebar-width:     200px;
  --sub-sidebar-width: 200px;
  --preview-panel-width: 300px;

  --theme-font: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--theme-font);
  font-size: 15px;
  color: var(--clr-text);
  background: var(--clr-bg);
}
a { color: inherit; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: .8125rem; }

/* ── 공통: body.layout-* 는 전부 세로 flex(topbar 위, 콘텐츠 아래, footer 맨 아래) ── */
body[class^="layout-"] {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── top_bar ── */
.top_bar {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 20px;
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid #0f172a;
  z-index: 200;
}
.top_bar-lang {
  display: flex; align-items: center; gap: 5px;
  color: #cbd5e1; text-decoration: none; font-size: .75rem; font-weight: 600;
  padding: 5px 8px; border-radius: 6px; margin-right: 10px; transition: background .12s, color .12s;
  flex-shrink: 0;
}
.top_bar-lang:hover { background: var(--header-hover); color: #fff; }
.top_bar-brand { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.top_bar-logo { font-size: .95rem; font-weight: 700; color: var(--header-text); }
.top_bar-nav { display: flex; align-items: center; gap: 2px; margin-left: 16px; }
.top_bar-nav-item {
  color: #cbd5e1; text-decoration: none; font-size: .8125rem; font-weight: 500;
  padding: 6px 12px; border-radius: 6px; transition: background .12s, color .12s;
}
.top_bar-nav-item:hover { background: var(--header-hover); color: #fff; }
.top_bar-spacer { flex: 1; }
.top_bar-user { display: flex; align-items: center; gap: 12px; font-size: .8125rem; color: #cbd5e1; }
.top_bar-logout { display: flex; align-items: center; color: #cbd5e1; text-decoration: none; padding: 5px 8px; border-radius: 6px; transition: background .12s; }
.top_bar-logout:hover { background: var(--header-hover); color: #fff; }
.top_bar-logout-form button.top_bar-logout {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}
.top_bar-admin { display: flex; align-items: center; color: #cbd5e1; padding: 5px 8px; border-radius: 6px; transition: background .12s, color .12s; }
.top_bar-admin:hover { background: var(--header-hover); color: #fff; }
.top_bar-help {
  display: flex; align-items: center; color: #cbd5e1; background: none; border: none;
  padding: 5px 8px; border-radius: 6px; margin-right: 8px; cursor: pointer; transition: background .12s, color .12s;
}
.top_bar-help:hover { background: var(--header-hover); color: #fff; }

/* ── 모든 footer 영역(전역 footer + 각 패널 footer) 공용 스타일 —
   list-panel-footer 기준으로 통일. 안의 텍스트는 .footer-text 클래스로 통일한다 ── */
.footer,
.page-footer,
.main-footer,
.sub-main-footer,
.sidebar-footer,
.sub-sidebar-footer,
.list-panel-footer,
.editor-panel-footer,
.cal-footer {
  flex-shrink: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--clr-border);
  font-size: .75rem;
  color: #9ca3af;
}
.footer { text-align: center; }
.footer-text { color: inherit; }

/* editor-panel-footer/sub-main-footer/sub-sidebar-footer/sidebar-footer/page-footer는
   감춤 처리 — 전역 footer/list-panel-footer/cal-footer는 그대로 유지 */
.editor-panel-footer,
.sub-main-footer,
.sub-sidebar-footer,
.sidebar-footer,
.page-footer {
  display: none;
}

/* =============================================================
   layout-page — top_bar + page(header/body/footer) + footer
   ============================================================= */
.layout-page .page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page-header {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 28px; background: #fff;
  border-bottom: 1px solid #eee; flex-shrink: 0;
}
.page-title { font-size: 1.2rem; font-weight: 700; color: #1e293b; margin: 0; }
.page-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px;
}

/* =============================================================
   preview / preview-panel — 콘텐츠 옆에 나란히 표시되는 사이드 패널
   (freeitm_webmail의 .pp 컴포넌트 패턴을 범용 클래스명으로 재구성)
   ============================================================= */
.preview { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.preview > .page-body,
.preview > .main-body,
.preview > .sub-main-body,
.preview > .cal-body { flex: 1; min-width: 0; overflow-y: auto; }

.preview-panel {
  width: var(--preview-panel-width);
  min-width: 220px;
  max-width: 480px;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.preview-panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--clr-border);
  flex-shrink: 0;
}
.preview-panel-title { font-size: 13px; font-weight: 700; color: #111827; flex: 1; word-break: break-all; }
.preview-panel-close {
  background: none; border: none; cursor: pointer; color: #9ca3af;
  font-size: 16px; line-height: 1; border-radius: 4px; padding: 2px 5px;
  transition: color .1s, background .1s;
}
.preview-panel-close:hover { color: #374151; background: #f3f4f6; }
.preview-panel-body { flex: 1; padding: 8px 0; }
.preview-panel-sec { padding: 8px 0; border-bottom: 1px solid var(--clr-border-light); }
.preview-panel-sec:last-child { border-bottom: none; }
.preview-panel-sec-title {
  font-size: 10px; font-weight: 700; color: #9ca3af; text-transform: uppercase;
  letter-spacing: .7px; padding: 0 16px 6px; display: flex; align-items: center; gap: 6px;
}
.preview-panel-sec-title::before { content: ''; width: 3px; height: 10px; background: var(--clr-primary); border-radius: 9999px; }
.preview-panel-row { display: flex; gap: 10px; padding: 4px 16px; font-size: 12.5px; }
.preview-panel-row .k { color: #9ca3af; width: 46px; flex-shrink: 0; }
.preview-panel-row .v { color: var(--clr-text); word-break: break-all; }

/* file-preview-thumb — 파일 미리보기 이미지/페이지 영역 (portal의 .pp-sec.pp-slides를 이름만 바꿔 재구성) */
@keyframes filePreviewThumbSpin { to { transform: rotate(360deg); } }
.file-preview-thumb { border-bottom: 1px solid var(--clr-border-light); }
.file-preview-thumb-canvas {
  padding: 10px 12px; min-height: 60px; display: flex;
  align-items: center; justify-content: center; background: #f9fafb;
}
.file-preview-thumb-canvas img { display: block; width: 100%; max-width: 100%; height: auto; object-fit: contain; border-radius: 4px; }
.file-preview-thumb-loading {
  color: #9ca3af; font-size: 12px; padding: 14px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.file-preview-thumb-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 7px 12px 10px;
  border-top: 1px solid var(--clr-border);
}
.file-preview-thumb-nav-btn {
  background: none; border: 1.5px solid #e5e7eb; border-radius: 6px;
  width: 28px; height: 28px; cursor: pointer; font-size: 11px;
  color: #6b7280; display: flex; align-items: center; justify-content: center;
  transition: background .12s; font-family: inherit;
}
.file-preview-thumb-nav-btn:hover:not(:disabled) { background: #f3f4f6; color: var(--clr-primary); }
.file-preview-thumb-nav-btn:disabled { opacity: .35; cursor: default; }
.file-preview-thumb-nav-info { font-size: 12px; color: #6b7280; font-weight: 600; min-width: 54px; text-align: center; }

/* =============================================================
   layout-basic — sidebar + main(header/body/footer)
   ============================================================= */
.layout-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }

.sidebar {
  width: var(--sidebar-width); flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--clr-border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar-header { height: 52px; padding: 0 16px; display: flex; align-items: center; border-bottom: 1px solid #eee; flex-shrink: 0; }
.sidebar-title { font-size: .95rem; font-weight: 700; color: #1e293b; }
.sidebar-nav { list-style: none; margin: 0; padding: 0; flex: 1; }
.sidebar-nav li a {
  display: flex; align-items: center; height: 38px; padding: 0 16px;
  color: #374151; text-decoration: none; font-size: .875rem;
  border-left: 3px solid transparent; transition: background .12s, color .12s, border-color .12s;
}
.sidebar-nav li a:hover { background: var(--nav-hover-bg); }
.sidebar-nav li a.active { background: var(--nav-active-bg); color: var(--clr-primary); border-left-color: var(--clr-primary-hover); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.main-header {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 28px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.main-title { font-size: 1.2rem; font-weight: 700; color: #1e293b; margin: 0; }
.main-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px; }

/* =============================================================
   layout-basic-sub — sidebar + sub-sidebar + sub-main(header/body/footer)
   ============================================================= */
.sub-sidebar {
  width: var(--sub-sidebar-width); flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--clr-border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.sub-sidebar-header { height: 52px; padding: 0 16px; display: flex; align-items: center; border-bottom: 1px solid #eee; flex-shrink: 0; }
.sub-sidebar-title { font-size: .95rem; font-weight: 700; color: #1e293b; }
.sub-sidebar-nav { list-style: none; margin: 0; padding: 0px 0; flex: 1; }
.sub-sidebar-nav li a {
  display: flex; align-items: center; height: 34px; padding: 0 16px;
  color: #374151; text-decoration: none; font-size: .8125rem;
  border-left: 3px solid transparent; transition: background .12s, color .12s, border-color .12s;
}
.sub-sidebar-nav li a:hover { background: var(--nav-hover-bg); }
.sub-sidebar-nav li a.active { background: var(--nav-active-bg); color: var(--clr-primary); border-left-color: var(--clr-primary-hover); font-weight: 600; }

.sub-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.sub-main-header {
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 28px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.sub-main-title { font-size: 1.2rem; font-weight: 700; color: #1e293b; margin: 0; }
.sub-main-body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px; display: flex; }

/* sub-main-body가 리스트/에디터처럼 자식을 나란히 배치해야 하는 페이지에서는
   padding을 없애고 자식 패널이 꽉 채우도록 한다 */
.sub-main-body:has(.list-panel),
.sub-main-body:has(.cal-month),
.sub-main-body:has(.cal-week),
.sub-main-body:has(.cal-day),
.sub-main-body:has(.cal-list) { padding: 0; }
.sub-main-body:has(.basic-tab) { flex-direction: column; padding: 0; overflow-y: auto; }

/* =============================================================
   layout-basic-list — list-panel + editor-panel(+ preview-panel)
   ============================================================= */
.list-panel {
  width: 280px; flex-shrink: 0;
  border-right: 1px solid var(--clr-border);
  display: flex; flex-direction: column; overflow: hidden; background: #fff;
}
.list-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 16px; border-bottom: 1px solid var(--clr-border); flex-shrink: 0;
}
.list-panel-title { font-size: .875rem; font-weight: 700; color: #1e293b; }
.list-panel-body { flex: 1; min-height: 0; overflow-y: auto; }
/* list-panel-body/editor-panel-body에 표시할 내용이 없을 때(목록 없음, 선택 없음, 오류 등)와
   불러오는 중일 때 공통으로 쓰는 표시 - portal(이 리포)의 mail.ejs .mail-empty 패턴과 동일하게
   통일(같은 정의를 두 클래스명으로 등록 - empty=내용 없음, loading=불러오는 중) */
.empty, .loading { display: flex; align-items: center; justify-content: center; min-height: 140px; padding: 24px; text-align: center; font-size: .8125rem; color: var(--clr-text-sub); }
.list-item {
  display: block; padding: 10px 16px; cursor: pointer; border-bottom: 1px solid var(--clr-border-light);
  transition: background .1s; text-decoration: none; color: inherit;
}
.list-item:hover { background: var(--nav-hover-bg); }
.list-item.active { background: var(--nav-active-bg); border-left: 3px solid var(--clr-primary); padding-left: 13px; }
.list-item-title { font-size: .8125rem; font-weight: 600; color: #1e293b; }
.list-item-sub { font-size: .75rem; color: #9ca3af; margin-top: 2px; }

/* ── 내 저장소(mystorage) 파일/폴더 카드 그리드 - portal(www.freeitm.com 아님, 이 리포의
   /storage/mystorage) storage.ejs의 .st-item 패턴을 file-item으로 재명명해 이식 ── */
.file-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--clr-text-sub); letter-spacing: .06em; margin: 0 0 10px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.file-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px 10px; border: 1px solid var(--clr-border); border-radius: 10px;
  cursor: pointer; text-align: center; position: relative;
  transition: box-shadow .15s, border-color .15s;
}
.file-item:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); border-color: var(--clr-primary); }
.file-item-icon { display: flex; align-items: center; justify-content: center; }
.file-item-name { font-size: 12px; font-weight: 600; color: var(--clr-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.file-item-size { font-size: 10px; color: var(--clr-text-sub); }
.file-item-check { position: absolute; top: 6px; left: 6px; z-index: 2; cursor: pointer; width: 15px; height: 15px; }
.file-item.file-item-selected { outline: 2px solid var(--clr-primary); background: rgba(37,99,235,.07); border-color: var(--clr-primary); }
.file-item-fav-btn {
  position: absolute; top: 6px; right: 6px; background: none; border: none; cursor: pointer;
  padding: 3px; border-radius: 4px; line-height: 1; opacity: 0; transition: opacity .15s; z-index: 2;
}
.file-item:hover .file-item-fav-btn, .file-item-fav-btn.active { opacity: 1; }
.file-item-fav-btn:hover polygon { fill: #f59e0b !important; stroke: #f59e0b !important; }
.file-item-del-btn {
  position: absolute; bottom: 4px; right: 4px; background: none; border: none; cursor: pointer;
  padding: 3px; border-radius: 4px; color: var(--clr-text-sub); opacity: 0; transition: opacity .15s; z-index: 2;
}
.file-item:hover .file-item-del-btn { opacity: 1; }
.file-item-del-btn:hover { background: var(--nav-hover-bg); color: #ef4444; }
.file-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; gap: 12px; color: var(--clr-text-sub); font-size: 13px;
}
.file-empty svg { opacity: .35; }

.editor-panel {
  flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff;
}
.editor-panel-header {
  display: flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 20px; border-bottom: 1px solid var(--clr-border); flex-shrink: 0;
}
.editor-panel-title { font-size: .95rem; font-weight: 700; color: #1e293b; }
.editor-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.editor-panel-body:has(.basic-tab) { padding: 0; display: flex; flex-direction: column; }

.field-row { margin-bottom: 16px; }
.field-row label { display: block; font-size: .75rem; font-weight: 600; color: #64748b; margin-bottom: 6px; }
.field-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--clr-border); border-radius: 6px;
  font-size: .8125rem; color: #1e293b; background: #fff; outline: none; transition: border-color .12s;
}
.field-input:focus { border-color: var(--clr-primary-hover); }
textarea.field-input { resize: vertical; }
select.field-input {
  padding-right: 32px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
  cursor: pointer;
}

.settings-form { max-width: 360px; padding: 24px 28px; }
.settings-form-msg { font-size: .75rem; color: #16a34a; margin-top: 8px; display: none; }
.field-color-input {
  width: 56px; height: 34px; padding: 2px; border: 1px solid var(--clr-border); border-radius: 6px;
  cursor: pointer; background: #fff;
}

/* =============================================================
   basic-btn / basic-svg-btn — 공용 버튼 (freeitm_webmail과 동일한 규칙)
   ============================================================= */
.basic-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 16px; border-radius: 6px; border: 1px solid transparent;
  font-size: .8125rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s;
  background: var(--btn-secondary-bg); color: var(--btn-secondary-text);
  box-sizing: border-box;
}
.basic-btn.primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); border-color: var(--btn-primary-bg); }
.basic-btn.primary:hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); }
.basic-btn.second { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); border-color: var(--btn-second-border); }
.basic-btn.second:hover { background: var(--btn-second-hover); border-color: var(--btn-second-hover); }
.basic-btn.cancel { background: none; color: var(--btn-cancel-text); border-color: var(--btn-primary-bg); }
.basic-btn.cancel:hover { background: var(--btn-cancel-hover); border-color: var(--btn-primary-hover); }
.basic-btn.danger { background: var(--btn-danger-bg); color: var(--btn-danger-text); border-color: var(--btn-danger-bg); }
.basic-btn.danger:hover { background: var(--btn-danger-hover); border-color: var(--btn-danger-hover); }

.basic-svg-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 0;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  background: none;
  margin: 0 5px;
  color: var(--basic-svg-color, #111827);
  justify-content: center;
  border: none;
}
.basic-svg-btn:hover { background: none; opacity: .7; }

/* basic-btn/basic-svg-btn 그룹을 감싸 헤더 오른쪽으로 밀어주는 공용 래퍼 —
   page-header-actions/editor-panel-actions 등 basic-btn을 감싸던 곳은 모두 basic-btn-action으로 통일 */
.basic-btn-action, .basic-svg-btn-action { margin-left: auto; display: flex; gap: 8px; }

/* =============================================================
   layout-basic-cal — cal-header/cal-body/cal-footer
   (https://mail.freeitm.com/calendars 캘린더 스타일 그대로 반영)
   ============================================================= */
.cal-header {
  display: flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 24px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.cal-nav-group { display: flex; align-items: center; gap: 6px; }
.cal-title { font-size: 1.05rem; font-weight: 700; color: #1e293b; min-width: 130px; }
.cal-view-tabs { display: flex; gap: 2px; margin-left: auto; background: #f1f5f9; border-radius: 8px; padding: 3px; }
.cal-view-btn {
  border: none; background: none; padding: 6px 14px; border-radius: 6px;
  font-size: .8125rem; font-weight: 600; color: #64748b; cursor: pointer;
  transition: background .12s, color .12s; font-family: inherit;
}
.cal-view-btn:hover { color: #1e293b; }
.cal-view-btn.active { background: #fff; color: var(--clr-primary); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.cal-body { flex: 1; min-height: 0; overflow-y: auto; background: #fff; }

/* ── 월간 뷰 ── */
.cal-month { display: flex; flex-direction: column; min-height: 100%; }
.cal-month-head { display: flex; border-bottom: 1px solid var(--clr-border); flex-shrink: 0; }
.cal-dow { flex: 1; text-align: center; padding: 8px 0; font-size: .75rem; font-weight: 600; color: #64748b; }
.cal-dow.cal-sun { color: #ef4444; }
.cal-dow.cal-sat { color: #2563eb; }
.cal-month-body { display: flex; flex-direction: column; flex: 1; }
.cal-week-row { display: flex; flex: 1; min-height: 100px; }
.cal-day-cell {
  flex: 1; min-width: 0; border-right: 1px solid #f1f5f9; border-bottom: 1px solid #f1f5f9;
  padding: 6px 6px 4px; cursor: pointer; transition: background .1s; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.cal-day-cell:hover { background: #f9fafb; }
.cal-day-cell:last-child { border-right: none; }
.cal-other-month { background: #fafbfc; }
.cal-other-month .cal-day-num { color: #cbd5e1; }
.cal-today { background: #f5f3ff; }
.cal-today:hover { background: #efeafd; }
.cal-day-num { font-size: .8125rem; color: #374151; font-weight: 500; margin-bottom: 2px; }
.cal-today-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--clr-primary); color: #fff; font-weight: 700; font-size: .75rem;
}
.cal-evt-bar {
  font-size: .6875rem; color: #fff; background: var(--clr-primary); padding: 2px 6px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; line-height: 1.5;
}
.cal-evt-bar:hover { opacity: .85; }
.cal-evt-time { font-weight: 600; margin-right: 3px; opacity: .9; }
.cal-more { font-size: .6875rem; color: #64748b; padding: 1px 6px; cursor: pointer; }
.cal-more:hover { color: #1e293b; }

/* ── 주간/일간 뷰(시간대) ── */
.cal-week, .cal-day { display: flex; flex-direction: column; min-height: 100%; }
.cal-week-head { display: flex; border-bottom: 1px solid var(--clr-border); flex-shrink: 0; }
.cal-week-head > div:first-child { width: 56px; flex-shrink: 0; }
.cal-week-col-head { flex: 1; text-align: center; padding: 8px 0; font-size: .75rem; font-weight: 600; color: #64748b; }
.cal-week-date { font-size: .9rem; font-weight: 700; color: #1e293b; }
.cal-week-date.cal-today-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--clr-primary); color: #fff; margin-top: 2px; font-size: .8125rem;
}
.cal-allday-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--clr-border); flex-shrink: 0; }
.cal-evt-pill {
  font-size: .75rem; color: #1e293b; background: #eef2ff; border: 1px solid var(--clr-border);
  border-radius: 6px; padding: 6px 8px; margin-bottom: 4px; cursor: pointer;
}
.cal-evt-pill-title { font-weight: 700; margin-bottom: 2px; }
.cal-inline-checklist { list-style: none; margin: 0; padding: 0; }
.cal-inline-checklist li { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.cal-inline-checklist label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: .75rem; }
.cal-inline-checklist input[type="checkbox"] { cursor: pointer; flex-shrink: 0; }
.cal-inline-checklist span.done { color: #9ca3af; text-decoration: line-through; }
.cal-hour-row { display: flex; min-height: 48px; border-bottom: 1px solid #f1f5f9; }
.cal-time-gutter { width: 56px; flex-shrink: 0; text-align: right; padding: 0 8px; font-size: .6875rem; color: #94a3b8; transform: translateY(-7px); }
.cal-week-cell { flex: 1; min-width: 0; border-left: 1px solid #f1f5f9; padding: 2px 4px; display: flex; flex-direction: column; gap: 2px; }
.cal-day-cell-full { flex: 1; border-left: 1px solid #f1f5f9; padding: 2px 8px; display: flex; flex-direction: column; gap: 2px; }

/* ── 목록 뷰 ── */
.cal-list { padding: 6px 0; }
.cal-list-date { font-size: .75rem; font-weight: 700; color: #64748b; text-transform: uppercase; padding: 14px 22px 6px; letter-spacing: .3px; }
.cal-list-item { padding: 9px 22px; cursor: pointer; transition: background .1s; border-bottom: 1px solid #f8f9fb; }
.cal-list-item:hover { background: #f9fafb; }
.cal-list-title { font-size: .8125rem; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.cal-empty { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 200px; color: #94a3b8; font-size: .875rem; }

/* =============================================================
   /example 데모 전용 (실제 앱에서는 쓰이지 않는 시각화 보조 스타일)
   ============================================================= */
.basic-widget {
  border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 20px;
  color: #64748b; font-size: .875rem; line-height: 1.6;
}
.basic-widget-header { margin-bottom: 10px; }
.basic-widget-label {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--clr-primary);
  background: #ede9fe; padding: 3px 9px; border-radius: 5px;
}
.example-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

/* 여러 basic-widget/example-grid를 세로로 쌓을 때 쓰는 공용 레이아웃 유틸 */
.stack { display: flex; flex-direction: column; gap: 20px; }

.today-date { font-size: 1.05rem; font-weight: 600; color: #1e293b; margin: 0; }

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--clr-border-light); }
.todo-list li:last-child { border-bottom: none; }
.todo-list li span { flex: 1; }
.todo-list li.done span { color: #9ca3af; text-decoration: line-through; }
.todo-list-empty { font-size: .8125rem; color: #94a3b8; margin: 0; }
.todo-attach-icon { display: flex; align-items: center; color: #94a3b8; flex-shrink: 0; }
.todo-attach-icon:hover { color: var(--clr-primary, #2563eb); }

/* Todo 목록 아래 "음성녹음"/"사진" 빠른 등록 버튼 — 사진은 basic-btn-file과 동일하게
   실제 input[type=file]을 숨기고 label 클릭으로 파일 선택창을 연다 */
.todo-capture-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--clr-border-light); }
.todo-capture-btn { position: relative; }
.todo-capture-btn input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.todo-capture-btn.recording { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.todo-capture-status { font-size: .75rem; color: #64748b; }
/* card-item(카드형 목록 항목)/shepherd 툴팁 공통 껍데기 — microsoft.com/microsoft-teams/download-app의
   card__content(실측: 24px padding, flex column, 카드 자체는 border 없이 24px 라운드+
   2단 soft shadow)를 그대로 옮긴 것. shepherd-element는 새 class 없이 이 selector에
   같이 묶어서 동일한 룩앤필을 공유한다 */
.card-item, .shepherd-element {
  border: none;
  border-radius: 8px;
  background: var(--clr-surface);
  box-shadow: 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.14);
}
.card-item {
  display: flex; flex-direction: column; padding: 24px;
  text-decoration: none; transition: box-shadow .12s, transform .12s;
}
.card-item:hover { box-shadow: 0 0 2px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.18); transform: translateY(-2px); }
.card-item-name { font-size: 1rem; font-weight: 700; color: var(--clr-text); font-family: var(--theme-font); line-height: 1.5; }
.card-item-desc, .shepherd-text {
  font-family: var(--theme-font); font-size: .8125rem; color: var(--clr-text-sub); line-height: 1.5;
}
.card-item-desc { margin-top: 6px; }
.card-item-disabled { cursor: default; background: #fafbfc; box-shadow: none; }
.card-item-disabled:hover { box-shadow: none; transform: none; }
.card-item-badge {
  display: inline-block; font-size: .6875rem; font-weight: 700; font-family: var(--theme-font);
  color: #15803d; background: #f0fdf4; border-radius: 9999px; padding: 2px 8px; margin-left: 8px;
  vertical-align: middle;
}

/* =============================================================
   반응형 — 작은 화면(태블릿/모바일)
   ============================================================= */
@media (max-width: 640px) {
  .top_bar { padding: 0 12px; }
  .top_bar-email { display: none; }
  .top_bar-logo { font-size: .85rem; }

  .page-header, .main-header, .sub-main-header {
    padding: 0 16px; height: auto; min-height: 52px; flex-wrap: wrap; row-gap: 8px;
  }
  .page-body, .main-body, .sub-main-body { padding: 16px; }
  .page-footer, .main-footer, .sub-main-footer, .footer, .sidebar-footer, .sub-sidebar-footer { padding: 8px 12px; }

  .stack { gap: 14px; }
  .basic-widget { padding: 14px; }
  .example-grid { grid-template-columns: 1fr; }

  .cal-header { padding: 0 12px; flex-wrap: wrap; row-gap: 8px; }
  .cal-title { min-width: 0; }
  .cal-view-tabs { margin-left: 0; }

  .editor-panel-body { padding: 14px; }
}

/* =============================================================
   modal-overlay / modal-box — portal.smartertools.co.kr/mail의
   모달 패턴과 동일한 클래스/값 (public/js/modal.js의 _Modal과 함께 사용)
   ============================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s, visibility .18s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-overlay.open .modal-box { transform: translateY(0); }

.modal-box {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 24px 24px 20px;
  width: 340px;
  max-width: 95vw;
  transform: translateY(8px);
  transition: transform .18s;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 18px;
  padding-right: 32px;
}

.modal-field { margin-bottom: 14px; }

.modal-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  display: block;
}

.modal-select {
  width: 100%;
  padding: 8px 32px 8px 11px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 13px;
  color: #333;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  outline: none;
  box-sizing: border-box;
  box-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  line-height: 1.5;
  transition: border-color .15s;
}
.modal-select:focus { border-color: #1a73e8; outline: none; }

.modal-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 13px;
  color: #333;
  outline: none;
  box-sizing: border-box;
}
.modal-input:focus { border-color: #1a73e8; }

.modal-footer { display: flex; align-items: center; gap: 8px; }
.modal-box .modal-footer { justify-content: flex-end; margin-top: 20px; }

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  padding: 0;
  line-height: 1;
  transition: background .1s;
  flex-shrink: 0;
}
.modal-close-btn:hover { background: #f1f5f9; color: #1e293b; }
.modal-close-btn svg { display: block; pointer-events: none; }

/* =============================================================
   /admin/tours — 온보딩 가이드 빌더(iframe 요소 선택 + 스텝 목록)
   ============================================================= */
.tour-iframe-wrap { position: relative; width: 100%; height: 100%; }
.tour-iframe { width: 100%; height: 100%; border: none; display: block; background: #fff; }
.tour-pick-msg {
  display: none; position: absolute; top: 10px; left: 10px; z-index: 20;
  background: #111827; color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 12px;
}
.tour-step-item {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--clr-border-light); cursor: pointer;
}
.tour-step-item:hover { background: var(--nav-hover-bg); }
.tour-step-num {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--clr-primary);
  color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.tour-step-main { flex: 1; min-width: 0; }
.tour-step-title { font-size: .8125rem; font-weight: 600; color: #1e293b; }
.tour-step-selector { font-size: .75rem; color: #94a3b8; font-family: monospace; word-break: break-all; }
.tour-step-page {
  display: inline-block; margin-top: 3px; font-size: .6875rem; font-weight: 600;
  color: var(--clr-primary, #2563eb); background: #eff6ff; border-radius: 4px; padding: 1px 6px;
}
.tour-step-actions { display: flex; gap: 4px; flex-shrink: 0; }
.tour-step-actions button {
  width: 22px; height: 22px; border: none; background: none; cursor: pointer;
  color: #9ca3af; border-radius: 4px; font-size: 12px; line-height: 1;
}
.tour-step-actions button:hover { background: #f1f5f9; color: #1e293b; }
.tour-path-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  height: 34px; padding: 0 16px; color: #374151; font-size: .8125rem; cursor: pointer;
  border-left: 3px solid transparent; transition: background .12s, color .12s, border-color .12s;
}
.tour-path-item:hover { background: var(--nav-hover-bg); }
.tour-path-item.active { background: var(--nav-active-bg); color: var(--clr-primary); border-left-color: var(--clr-primary-hover); font-weight: 600; }
.tour-path-badge {
  font-size: 10px; font-weight: 700; color: #64748b; background: #f1f5f9; border-radius: 9999px;
  padding: 1px 7px; flex-shrink: 0;
}

/* shepherd.js 기본 테마 위에 이 프로젝트의 강조색만 살짝 맞춘다. 카드 껍데기(둥근 모서리/
   그림자/배경)는 위쪽 .card-item, .shepherd-element 규칙이 이미 담당하므로, 안쪽 래퍼는
   그 모양을 그대로 물려받게 하고(border-radius: inherit) 텍스트 영역에만 카드와 같은
   24px 여백을 준다 */
.shepherd-content { padding: 0; border-radius: inherit; }
/* 헤더와 본문 사이 간격을 없애 붙여 보이게 한다(위쪽 padding 0) */
.shepherd-text { padding: 0 24px 24px; }
.shepherd-has-title .shepherd-content .shepherd-header {
  background: var(--clr-surface, #fff);
  border-top-left-radius: inherit; border-top-right-radius: inherit;
  padding: 24px 24px 0;
}
.shepherd-arrow, .shepherd-element .shepherd-arrow { display: none; }
.shepherd-footer { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; padding: 0 24px 24px; }
.shepherd-button:not(.shepherd-button-secondary) { background: var(--btn-primary-bg); }
.shepherd-button:not(.shepherd-button-secondary):hover { background: var(--btn-primary-hover); }

/* 스텝 제목 위 "N/총단계" — shepherd-title을 세로로 쌓아 카운터를 제목 위 왼쪽에 배치 */
.shepherd-title { flex-direction: column; align-items: flex-start; gap: 2px; }
.tour-step-progress { font-size: .6875rem; font-weight: 700; color: var(--clr-text-sub); font-family: var(--theme-font); }
.tour-step-title-text { font-size: 1rem; font-weight: 700; color: var(--clr-text); font-family: var(--theme-font); }

/* 이전/다음 아이콘 버튼(< >) — shepherd-button의 배경/색상은 그대로 물려받고 모양만 원형으로 */
.shepherd-button.tour-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
}

/* 스텝 본문 안 첨부파일 다운로드 링크 */
.tour-attachment-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 6px 12px; border-radius: 6px; background: var(--clr-border-light);
  color: var(--clr-text); font-size: .75rem; font-weight: 600; text-decoration: none;
}
.tour-attachment-link:hover { background: var(--clr-border); }

/* 종일 일정만 다루는 주/일 보기 — 시간대 그리드 없이 날짜별 칸만 채운다 */
.cal-allday-only-body { display: flex; flex: 1; min-height: 0; }
.cal-allday-only-body .cal-week-cell,
.cal-allday-only-body .cal-day-cell-full { border-top: 1px solid #f1f5f9; align-items: stretch; }
.cal-allday-only-body .cal-week-cell { overflow-y: auto; }

/* =============================================================
   /admin/calendar — 일정 추가/편집 모달의 체크리스트 줄 편집기
   ============================================================= */
.cal-checklist-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.cal-checklist-row-check { flex-shrink: 0; cursor: pointer; }
.cal-checklist-row-text { flex: 1; }
.cal-checklist-row-del {
  flex-shrink: 0; width: 22px; height: 22px; border: none; background: none; cursor: pointer;
  color: #9ca3af; border-radius: 4px; font-size: 12px; line-height: 1;
}
.cal-checklist-row-del:hover { background: #f1f5f9; color: #1e293b; }

/* =============================================================
   basic-tab — portal.smartertools.co.kr/admin/system/office 참고
   (원본: /var/www/basic/styles.css에 이미 이식된 것과 동일한 규칙)
   ============================================================= */
.basic-tab {
  display: flex; flex-wrap: wrap; gap: 0;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  flex-shrink: 0;
  padding: 0 4px;
}
.basic-tab .tab-item {
  padding: .55rem .9rem; font-size: .8125rem; font-weight: 500; color: #6b7280;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s, border-color .12s; white-space: nowrap; user-select: none;
  display: flex; align-items: center; gap: 4px;
}
.basic-tab .tab-item:hover { color: #374151; }
.basic-tab .tab-item.active { color: var(--clr-primary, #2563eb); border-bottom-color: var(--clr-primary, #2563eb); font-weight: 600; }
.basic-tab-content { display: none; padding: 16px; }
.basic-tab-content.active { display: block; }

/* Music Setting 탭 안의 업로드 컨트롤/파일 목록 */
/* basic-btn-file — 네이티브 input[type=file]을 basic-btn과 동일한 톤으로 감싼 버튼.
   실제 input은 숨기고 label 클릭으로 파일 선택창을 연다(흔한 커스텀 파일버튼 패턴) */
.basic-btn-file {
  display: inline-flex; align-items: center; justify-content: center;
  height: 34px; padding: 0 16px; border-radius: 6px; border: 1px solid transparent;
  font-size: .8125rem; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s;
  background: var(--btn-secondary-bg); color: var(--btn-secondary-text);
  box-sizing: border-box; flex-shrink: 0;
}
.basic-btn-file:hover { background: var(--btn-second-hover); }
.basic-btn-file input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.basic-btn-file-name { font-size: .8125rem; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }

.music-upload-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.music-file-list { display: flex; flex-direction: column; gap: 1px; }
.music-file-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--clr-border-light); border-radius: 6px; margin-bottom: 4px;
}
.music-file-item a { font-size: .8125rem; color: #1e293b; font-weight: 500; text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-file-item a:hover { color: var(--clr-primary-hover); text-decoration: underline; }
.music-file-size { font-size: .75rem; color: #94a3b8; flex-shrink: 0; }
.music-file-grade {
  font-size: .6875rem; font-weight: 600; color: var(--clr-primary, #2563eb);
  background: #eff6ff; border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
}
.music-file-del {
  flex-shrink: 0; width: 22px; height: 22px; border: none; background: none; cursor: pointer;
  color: #9ca3af; border-radius: 4px; font-size: 12px; line-height: 1;
}
.music-file-del:hover { background: #f1f5f9; color: #dc2626; }
.music-file-empty { font-size: .8125rem; color: #94a3b8; padding: 8px 2px; }

/* Music 참고자료 업로드 — 탭에 속하지 않는 공통 영역, .basic-tab 위에 위치 */
.music-common-upload { padding: 16px; border-bottom: 1px solid var(--clr-border-light); flex-shrink: 0; }
.music-common-upload .music-upload-row { margin-bottom: 12px; }
.music-common-upload .music-file-list { max-height: 160px; overflow-y: auto; }
.music-grade-select { width: auto; min-width: 130px; flex-shrink: 0; }

/* Music 탭 서브항목(N.1~N.5) — 문서 유형 설명 입력 + 개별 AI 문제 생성 버튼 */
.music-subitem-list { display: flex; flex-direction: column; gap: 16px; }
.music-subitem-row {
  display: flex; flex-direction: column; gap: 6px;
  padding-bottom: 16px; border-bottom: 1px solid var(--clr-border-light);
}
.music-subitem-row:last-child { border-bottom: none; padding-bottom: 0; }
.music-subitem-key { font-size: .8125rem; font-weight: 700; color: #6b7280; }
.music-subitem-desc { width: 100%; min-height: 72px; resize: vertical; font-family: inherit; box-sizing: border-box; }
.music-subitem-actions { display: flex; align-items: center; gap: 8px; }
.music-subitem-count { width: 56px; flex-shrink: 0; text-align: center; }
.music-subitem-status { font-size: .75rem; color: #64748b; }
.music-subitem-status.error { color: #dc2626; }
.music-subitem-status.done { color: #16a34a; }

/* 서브항목별 참고 악보 이미지 — 붙여넣기(Ctrl+V)/파일선택 즉시 자동 업로드 zone
   (별도 Upload 버튼 없음, 클릭하면 파일선택창이 뜨고 포커스된 채로 붙여넣기 가능) */
.music-subitem-image-zone {
  border: 1px dashed var(--clr-border-light); border-radius: 6px; padding: 10px 12px;
  cursor: pointer; transition: border-color .12s, background .12s; outline: none;
}
.music-subitem-image-zone:hover, .music-subitem-image-zone:focus { border-color: #94a3b8; background: #f8fafc; }
.music-subitem-image-preview { display: flex; align-items: center; gap: 10px; }
.music-subitem-image-placeholder { font-size: .75rem; color: #94a3b8; }
.music-subitem-image-thumb { max-width: 160px; max-height: 90px; border-radius: 4px; border: 1px solid var(--clr-border-light); display: block; }
.music-subitem-image-remove {
  border: none; background: #f1f5f9; color: #64748b; width: 20px; height: 20px; border-radius: 50%;
  cursor: pointer; font-size: .6875rem; line-height: 1; flex-shrink: 0;
}
.music-subitem-image-remove:hover { background: #fee2e2; color: #dc2626; }

/* Music in Context(7번) 탭 — 서브항목 설명 대신 공통 악보 이미지 1장 업로드 */
.music-context-image-preview {
  display: block; max-width: 100%; max-height: 320px; margin-bottom: 12px;
  border: 1px solid var(--clr-border-light); border-radius: 6px;
}

/* 문항 세트 상세 상단 — 서브항목 참고 이미지를 생성된 문항과 나란히 놓고 비교 확인 */
.music-ref-compare {
  padding: 12px 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--clr-border-light);
}
.music-ref-compare-label { font-size: .75rem; font-weight: 700; color: #6b7280; margin-bottom: 8px; }

/* AI가 생성한 문항의 악보 이미지(VexFlow SVG, render-notation.js 출력을 그대로 삽입) —
   svg 태그 전체에 거는 전역 규칙 대신 이 래퍼 안에서만 적용해 다른 아이콘 svg에 영향 없게 함 */
.notation-svg-wrap svg { max-width: 100%; height: auto; display: block; }

/* 보기 자체가 악보 이미지인 문항 — 카드를 클릭해서 정답을 고르는 방식(ABRSM 기출 형식의
   "이미지 중 하나에 체크" 문제 유형) */
.music-image-choice-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.music-image-choice-option {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 2px solid var(--clr-border-light); border-radius: 8px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.music-image-choice-option:hover { border-color: #94a3b8; }
.music-image-choice-option.selected { border-color: var(--clr-primary, #2563eb); background: #eff6ff; }
.music-image-choice-option.correct-answer { border-color: #16a34a; background: #f0fdf4; }
.music-image-choice-option.wrong-selected { border-color: #dc2626; background: #fef2f2; }
.music-image-choice-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: #f1f5f9;
  color: #64748b; font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.music-image-choice-option.selected .music-image-choice-num { background: var(--clr-primary, #2563eb); color: #fff; }
.music-image-choice-option.correct-answer .music-image-choice-num { background: #16a34a; color: #fff; }
.music-image-choice-option.wrong-selected .music-image-choice-num { background: #dc2626; color: #fff; }
.music-image-choice-option .notation-svg-wrap { flex: 1; min-width: 0; }

/* =============================================================
   org-tree — 142.44.163.80:3031/manage/organization의 조직도 트리와
   동일한 스타일을 그대로 가져옴(/admin/organ 전용)
   ============================================================= */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; line-height: 1; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

.org-tree { padding: 6px 0; }
.org-tree-node { position: relative; }
.org-tree-row {
  display: flex; align-items: center; gap: 0;
  padding: 0; cursor: pointer; user-select: none;
  transition: background .1s;
}
.org-tree-row:hover { background: #f8faff; }
.org-tree-row.active { background: var(--nav-active-bg); }
.org-tree-row.active .org-tree-label { color: var(--clr-primary); font-weight: 600; }

.org-tree-connectors { display: flex; flex-shrink: 0; }

.org-tree-toggle-btn {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px; color: #94a3b8;
  transition: background .1s, color .1s;
  margin: 0 3px;
}
.org-tree-toggle-btn:hover { background: #e0e7ff; color: #2563eb; }
.org-tree-toggle-btn svg { transition: transform .15s; }
.org-tree-toggle-btn.open svg { transform: rotate(90deg); }
/* 토글 화살표가 없는(자식이 없는) 행도 있는 행과 동일한 깊이에서 아이콘/텍스트가
   왼쪽 정렬되어야 하므로, .org-tree-toggle-btn과 정확히 같은 박스 크기(18px+margin
   3px)를 유지해야 함 — 폭을 0으로 줄이면 같은 레벨 형제 노드끼리 정렬이 어긋남. */
.org-tree-toggle-spacer { width: 18px; height: 18px; flex-shrink: 0; margin: 0 3px; }

.org-tree-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #64748b; margin-right: 5px;
}
.org-tree-row.active .org-tree-icon { color: var(--clr-primary); }

.org-tree-label {
  flex: 1; min-width: 0;
  font-size: .8125rem; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 7px 4px 7px 0;
}
.org-tree-badge { flex-shrink: 0; margin-right: 10px; }
.org-tree-children { display: none; }
.org-tree-children.open { display: block; }
