/* =============================================================
   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; background: none; border: none; cursor: pointer;
}
.top_bar-lang:hover { background: var(--header-hover); color: #fff; }
.top_bar-lang-wrap { position: relative; flex-shrink: 0; }
.top_bar-lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 220;
  width: 120px; background: #fff; border: 1px solid var(--clr-border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: 4px 0;
}
.top_bar-lang-menu.open { display: block; }
.top_bar-lang-item { padding: 7px 12px; font-size: .8125rem; color: #374151; cursor: pointer; }
.top_bar-lang-item:hover { background: var(--nav-hover-bg); }
.top_bar-lang-item.active { color: var(--clr-primary); font-weight: 600; }
.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: 50vw;
  flex-shrink: 0;
  background: #fff;
  border-left: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.preview-panel-resize {
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  cursor: ew-resize; z-index: 5; transition: background .15s;
}
.preview-panel-resize:hover, .preview-panel-resize.dragging { background: rgba(37,99,235,.2); }
.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; }
.basic-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;
}
.basic-close:hover { color: #374151; background: #f3f4f6; }
.preview-panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0; }
/* preview-panel 안의 버튼(수정/삭제/공유/다운로드 등)은 body가 아니라 이 하단 고정 영역에
   모아 표시한다(2026-08-29) - list-panel-footer/editor-panel-footer와 같은 취지지만
   실제로 버튼을 담으므로 전역 footer 텍스트 스타일 대신 별도 규칙을 쓴다. */
.preview-panel-footer {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px;
  border-top: 1px solid var(--clr-border); flex-shrink: 0;
}
.preview-panel-footer:empty { display: none; }

/* 색상 팔레트 스와치 - 원래 note-new.ejs 전용 인라인 스타일이었던 것을 공용으로 옮김(2026-08-30) -
   캘린더 폴더 생성 등 "미리 정한 색 중 하나를 원형 스와치로 고르는" 다른 화면에서도 재사용. */
.note-color-picker { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.note-color-swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .15s; flex-shrink: 0; padding: 0; }
.note-color-swatch:hover { transform: scale(1.2); }
.note-color-swatch.active { transform: scale(1.15); }
.note-color-swatch svg { display: none; }
.note-color-swatch.active svg { display: block; }
.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; }
/* 폴더 모드 패널의 공유 목록 - 대상 이름 / 권한 배지 / 공유일 */
.preview-panel-share { display: flex; align-items: center; gap: 8px; padding: 5px 16px; font-size: 12.5px; }
.preview-panel-share .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--clr-text); }
.preview-panel-share .who small { display: block; color: #9ca3af; font-size: 11px; }
.preview-panel-share .perm { flex-shrink: 0; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 9999px; background: #eef2ff; color: #4338ca; }
.preview-panel-share .perm.write { background: #ecfdf5; color: #047857; }
.preview-panel-share .when { flex-shrink: 0; color: #9ca3af; font-size: 11px; }
.preview-panel-empty { padding: 6px 16px; font-size: 12.5px; color: #9ca3af; }

/* 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-resize { width: 5px; flex-shrink: 0; cursor: ew-resize; transition: background .15s; }
.sub-sidebar-resize:hover, .sub-sidebar-resize.dragging { background: rgba(37,99,235,.2); }
.sub-sidebar-header { height: 52px; padding: 7px; display: flex; align-items: center; border-bottom: 1px solid #eee; flex-shrink: 0; }
.sub-sidebar-title { font-size: .95rem; font-weight: 700; color: #1e293b; }
.sm-new-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 9px 20px;
    background: var(--clr-primary, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.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-sidebar-nav 안에 항목 그룹을 나누는 구획 라벨 (예: 주소록의 "나에게 공유된 주소록") */
.sub-sidebar-nav-label { padding: 10px 16px 4px; font-size: .75rem; color: var(--clr-text-sub); }
.sub-sidebar-nav li a .sub-nav-owner { color: var(--clr-text-sub); font-size: .75rem; }

.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; }
/* :has(.basic-tab)를 자손 전체가 아니라 "직계 자식"으로 좁힌다 - list-panel처럼 좁은
   영역 안에 basic-tab(필터탭)을 중첩해서 쓰는 페이지(mail 등)까지 이 규칙에 걸려
   list-panel/editor-panel 2단 레이아웃 전체가 세로로 무너지는 회귀가 실제로 있었음
   (mail 페이지에 필터탭 추가 후 발견) - 이 규칙은 .basic-tab이 sub-main-body 바로
   아래에 와서 그 영역 전체가 탭 하나짜리 단일 컬럼 페이지가 되는 경우만을 위한 것. */
.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-resize { width: 5px; flex-shrink: 0; cursor: ew-resize; transition: background .15s; }
.list-panel-resize:hover, .list-panel-resize.dragging { background: rgba(37,99,235,.2); }
.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-fav-btn.active polygon { fill: #f59e0b; stroke: #f59e0b; }
.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; }
/* 나에게 공유/내 공유/휴지통 카드 - 내 저장소 카드와 같은 모양에 hover 액션 아이콘(복원/완전삭제/공유 해제/다운로드)과 메타 줄 */
.file-item-meta { font-size: 10px; color: var(--clr-text-sub); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-actions { position: absolute; bottom: 4px; right: 4px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; z-index: 2; }
.file-item:hover .file-item-actions { opacity: 1; }
.file-item-act { background: none; border: none; cursor: pointer; padding: 3px; border-radius: 4px; color: var(--clr-text-sub); line-height: 1; display: flex; }
.file-item-act:hover { background: var(--nav-hover-bg); color: var(--clr-primary); }
.file-item-act.danger:hover { color: #ef4444; }
.file-item.file-item-static { cursor: default; }
/* 다중 선택 - 카드 왼쪽 위 체크박스(hover/선택 중에만 보임)와 목록 상단 선택 바 */
.file-item-check { opacity: 0; transition: opacity .15s; accent-color: var(--clr-primary); margin: 0; }
.file-item:hover .file-item-check, .file-item-check:checked, #stList.sel-mode .file-item-check { opacity: 1; }
.sel-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 8px 12px; border: 1px solid var(--clr-border); border-radius: 8px; background: #f8fafc; flex-wrap: wrap; }
.sel-bar-count { font-size: .8125rem; font-weight: 600; color: var(--clr-text); margin-right: auto; }
.sel-bar-btn { height: 30px; padding: 0 12px; gap: 6px; }
.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; }

/* 내 저장소 sub-main-header - 타이틀은 "내 저장소 / 상위 / 현재 폴더" 경로, 왼쪽 별 버튼으로
   지금 보고 있는 폴더를 즐겨찾기에 추가/해제한다(카드의 .file-item-fav-btn 과 같은 색 규칙). */
.sub-main-fav-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; padding: 0; margin-left: -6px; border: none; border-radius: 6px;
  background: none; color: #cbd5e1; cursor: pointer; transition: background .15s, color .15s;
}
.sub-main-fav-btn:hover { background: var(--nav-hover-bg); color: #f59e0b; }
.sub-main-fav-btn:hover polygon, .sub-main-fav-btn.active polygon { fill: #f59e0b; stroke: #f59e0b; }
.sub-main-fav-btn.active { color: #f59e0b; }
.sub-main-fav-btn[disabled] { opacity: .35; cursor: default; background: none; color: #cbd5e1; }
.sub-main-fav-btn[disabled]:hover polygon { fill: none; stroke: currentColor; }
#stTitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-main-title-path { color: var(--clr-text-sub); font-weight: 500; }
.sub-main-title-path a { color: inherit; text-decoration: none; }
.sub-main-title-path a:hover { text-decoration: underline; color: var(--clr-text); }
.sub-main-title-sep { margin: 0 6px; color: #cbd5e1; font-weight: 400; }
/* 타이틀 오른쪽 "+" - 누르면 버튼 자리에 인라인 입력 폼이 나와 현재 폴더 아래 하위 폴더를 바로 만든다 */
.sub-main-add-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: 6px;
  background: none; color: var(--clr-text-sub); cursor: pointer; transition: background .15s, color .15s;
}
.sub-main-add-btn:hover { background: var(--nav-hover-bg); color: #1a73e8; }
.sub-main-inline-form { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.sub-main-inline-input {
  width: 220px; max-width: 40vw; height: 30px; padding: 0 10px; border: 1px solid #ddd; border-radius: 6px;
  font-size: .8125rem; outline: none; box-sizing: border-box; background: #fff;
}
.sub-main-inline-input:focus { border-color: #1a73e8; }
.sub-main-inline-btn { height: 30px; padding: 0 12px; }

/* 파일 업로드 모달 - 위치 드롭다운 + 드래그앤드롭 영역 + 선택 파일 목록 */
.upload-modal-title { display: flex; align-items: center; gap: 8px; }
.upload-modal-title svg { color: var(--clr-primary); flex-shrink: 0; }
.upload-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 170px; padding: 28px 16px; border: 2px dashed #cbd5e1; border-radius: 12px;
  background: #f8fafc; color: #cbd5e1; cursor: pointer; text-align: center; user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.upload-dropzone:hover, .upload-dropzone:focus-visible, .upload-dropzone.dragover {
  border-color: var(--clr-primary); background: rgba(37,99,235,.05); color: var(--clr-primary); outline: none;
}
.upload-dropzone svg { pointer-events: none; }
.upload-dropzone-text { font-size: .875rem; font-weight: 600; color: #334155; }
.upload-dropzone-sub { font-size: .75rem; color: #94a3b8; }
.upload-dropzone-sub b { color: #64748b; font-weight: 600; }
.upload-file-list { margin-top: 10px; max-height: 150px; overflow-y: auto; }
.upload-file-list:empty { display: none; }
.upload-file-row {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #374151;
  padding: 6px 10px; border-radius: 6px; background: #f8fafc; margin-bottom: 4px;
}
.upload-file-row .upload-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-row .upload-file-size { color: #9ca3af; flex-shrink: 0; }
.upload-file-row .upload-file-rm { background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 16px; line-height: 1; padding: 0 2px; }
.upload-file-row .upload-file-rm:hover { color: #ef4444; }
.modal-footer .basic-btn > svg { margin-right: 6px; }

.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-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: 52px; 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 {
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; padding: 7px 10px; border-radius: 6px;
  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; }
/* 오늘 셀 표시 - 배경색+동그란 날짜 배지 대신 셀 전체를 두꺼운 테두리로 강조(2026-08-30).
   outline은 box-sizing에 안 잡혀서 다른 셀과 그리드 정렬이 안 틀어지고, 음수 offset으로
   셀 안쪽에 그려 overflow:hidden에 잘려나가지 않는다. */
.cal-today { outline: 2px solid var(--clr-primary); outline-offset: -2px; }
.cal-day-num { font-size: .8125rem; color: #374151; font-weight: 500; margin-bottom: 2px; }
.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; }

/* 일정 막대/칩에 마우스를 올렸을 때 보여주는 내용 미리보기 툴팁 (2026-08-29) */
.cal-evt-tooltip {
  position: fixed; z-index: 4000; display: none; max-width: 260px;
  background: #1e293b; color: #f1f5f9; border-radius: 8px; padding: 10px 12px;
  font-size: 12px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  pointer-events: none;
}
.cal-evt-tooltip-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.cal-evt-tooltip-row { color: #cbd5e1; }
.cal-evt-tooltip-desc { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.15); color: #e2e8f0; }
.cal-evt-tooltip-hint { margin-top: 6px; font-size: 10.5px; color: #94a3b8; font-style: italic; }

/* ── 주간/일간 뷰(시간대) ── */
.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; position: relative;
}
/* 주/일보기 시간칸 일정의 아래쪽 가장자리를 드래그해 시간을 늘리거나 줄이는 핸들(2026-08-30) */
/* 2026-08-30: 6px는 실측해보니 잡기 너무 얇아서(핀 자체 높이가 ~36px) 놓치기 쉬웠음 - 9px로 확대. */
.cal-evt-resize-handle { position: absolute; left: 0; right: 0; bottom: -3px; height: 9px; cursor: ns-resize; }
.cal-evt-resize-handle:hover { background: rgba(0, 0, 0, .08); border-radius: 0 0 6px 6px; }
.cal-evt-resize-tip { position: fixed; z-index: 50; background: #1e293b; color: #fff; font-size: .6875rem; padding: 2px 6px; border-radius: 4px; pointer-events: none; }
.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 .5rem; 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: 2px;
}
.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; }
.badge-green { background: #dcfce7; color: #15803d; }

.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); }

/* 목록 컨텍스트 메뉴(.ctx-menu) - cloud.freeitm.com style.css 의 규칙을 옮김 */
.ctx-menu {
  position: fixed; display: none; background: #fff; border: 1px solid #e2e5ea; border-radius: 9px;
  box-shadow: 0 8px 28px rgba(0,0,0,.14), 0 2px 6px rgba(0,0,0,.06);
  padding: 4px 0; min-width: 172px; z-index: 1200; transform-origin: top left; animation: ctxIn .1s ease;
}
.ctx-menu.visible { display: block; }
@keyframes ctxIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.ctx-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 13px; color: #333;
  cursor: pointer; user-select: none; transition: background .1s; white-space: nowrap;
}
.ctx-menu-item:hover { background: #f5f7fa; }
.ctx-menu-item svg { flex-shrink: 0; color: #888; }
.ctx-menu-item.danger { color: #dc2626; }
.ctx-menu-item.danger svg { color: #dc2626; }
.ctx-menu-item.danger:hover { background: #fee2e2; }
.ctx-menu-item.disabled { opacity: .35; cursor: default; pointer-events: none; }
.ctx-menu-divider { height: 1px; background: #f0f0f0; margin: 4px 0; }

.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; }

/* =============================================================
   mail — 검색/정렬/필터탭 + 메일 아이템(체크박스+아바타+발신/제목+시간/깃발/첨부) +
   editor-panel 액션 아이콘 + 빠른 회신 (참조: freeitm_webmail의 동일 기능, 클래스명은
   그 앱과 통일해서 신규 도입 - smplus-web에는 이 구조가 아직 없었음)
   ============================================================= */
.list-search-row { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--clr-border); flex-shrink: 0; }
.list-search-wrap { flex: 1; position: relative; display: flex; align-items: center; color: #9ca3af; }
.list-search-wrap svg { position: absolute; left: 8px; pointer-events: none; }
.list-search-input {
  width: 100%; padding: 6px 10px 6px 28px; border: 1px solid var(--clr-border); border-radius: 6px;
  font-size: .75rem; color: #1e293b; background: #fff; outline: none; transition: border-color .12s;
}
.list-search-input:focus { border-color: var(--clr-primary-hover); }
.list-sort-wrap { position: relative; flex-shrink: 0; }
.list-sort-btn {
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: 1px solid var(--clr-border); border-radius: 6px; background: #fff; color: #6b7280; cursor: pointer;
}
.list-sort-btn:hover { background: var(--nav-hover-bg); color: #1e293b; }
.list-sort-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  width: 160px; background: #fff; border: 1px solid var(--clr-border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: 4px 0;
}
.list-sort-menu.open { display: block; }
.list-sort-item { padding: 7px 12px; font-size: .8125rem; color: #374151; cursor: pointer; }
.list-sort-item:hover { background: var(--nav-hover-bg); }
.list-sort-item.active { color: var(--clr-primary); font-weight: 600; }

.mail-sel-all-label { display: flex; align-items: center; padding: 0 6px 0 8px; cursor: pointer; flex-shrink: 0; }
.mail-sel-all-label input { margin: 0; cursor: pointer; }

.mail-item {
  display: flex; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--clr-border-light);
  transition: background .1s; position: relative;
}
.mail-item:hover { background: var(--nav-hover-bg); }
.mail-item.selected { background: var(--nav-active-bg); border-left: 3px solid var(--clr-primary); padding-left: 11px; }
.mail-item.mail-item-checked { background: #eff6ff; }
/* 메일을 폴더로 드래그할 때 - mail.js의 wireFolderDropTargets()가 사이드바 폴더 링크(a[data-path])에
   이 클래스를 토글하는데, 여기 셀렉터가 .mail-item으로 한정되어 있어(폴더 링크는 그 클래스가 없음)
   실제로는 아무 표시도 안 되던 버그(2026-08-30) - 폴더 링크에도 걸리도록 셀렉터를 넓혀 수정. */
.mail-item-drop-target { background: #dbeafe; outline: 2px dashed var(--clr-primary); outline-offset: -2px; }
.mail-item-cb-wrap { display: flex; align-items: flex-start; padding-top: 2px; flex-shrink: 0; }
.mail-item-cb { margin: 0; cursor: pointer; }
.mail-item-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; color: #fff; font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.mail-item-content { flex: 1; min-width: 0; }
.mail-item-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mail-item-sender { font-size: .8125rem; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item.unread .mail-item-sender { font-weight: 700; color: #1e293b; }
.mail-item-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mail-item-time { font-size: .6875rem; color: #9ca3af; white-space: nowrap; }
.mail-flag-btn { background: none; border: none; padding: 1px; cursor: pointer; color: #d1d5db; display: flex; }
.mail-flag-btn:hover { color: #f59e0b; }
.mail-flag-btn.active { color: #f59e0b; }
.mail-item-row2 { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.mail-item-subject { flex: 1; min-width: 0; font-size: .75rem; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item.unread .mail-item-subject { color: #374151; }
.mail-attach-icon { flex-shrink: 0; color: #9ca3af; }

/* editor-panel-header 안에 자연스럽게 들어가는 액션 아이콘 - 그 헤더 자체가 이미
   flex+테두리를 갖고 있으므로(별도 박스로 안 만들고) 왼쪽 정렬로 아이콘만 나열 */
.action-icon-header { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.basic-svg-btn {
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: none; border-radius: 6px; background: none; color: #6b7280; cursor: pointer;
}
.basic-svg-btn:hover { background: var(--nav-hover-bg); color: #1e293b; }
.basic-svg-btn.active { color: var(--clr-primary, #2563eb); background: var(--nav-active-bg); }
.action-icon-sep { border-left: 1px solid var(--clr-border); height: 16px; margin: 0 4px; flex-shrink: 0; }

/* 제목/발신/수신/첨부 요약 - editor-panel-body(스크롤 영역) 밖의 형제 요소로 렌더한다
   (mail.ejs #editorMsgHdr, mail-view.ejs #mvHdr 참고). editor-panel-header/footer와
   동일하게 flex-shrink:0으로 둬야 본문이 길어져도 눌려서 찌그러지지 않는다. */
.mail-msg-hdr { padding: 16px 20px; border-bottom: 1px solid var(--clr-border); flex-shrink: 0; }
.mail-msg-subject { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.mail-meta-row { display: flex; gap: 8px; font-size: .75rem; color: #6b7280; padding: 2px 0; }
.mail-meta-label { width: 36px; flex-shrink: 0; color: #9ca3af; }
.mail-meta-val { color: #374151; word-break: break-all; }
.mail-addr-chip { cursor: pointer; border-bottom: 1px dashed #9ca3af; }
.mail-addr-chip:hover { color: var(--clr-primary); border-bottom-color: var(--clr-primary); }
.mail-msg-att { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.mail-att-item { font-size: .6875rem; background: var(--nav-hover-bg); border: 1px solid var(--clr-border); border-radius: 12px; padding: 3px 10px; cursor: pointer; color: #374151; }
.mail-body-plain { padding: 16px 20px; white-space: pre-wrap; word-break: break-word; font-size: .8125rem; }
.mail-body-iframe { width: 100%; border: none; }

.mail-quick-reply { padding: 10px 16px; border-top: 1px solid var(--clr-border); flex-shrink: 0; background: #fff; display: flex; gap: 8px; align-items: flex-end; }
.mail-quick-reply-input {
  flex: 1; resize: none; border: 1px solid var(--clr-border); border-radius: 8px; padding: 8px 10px;
  font-size: .8125rem; font-family: inherit; outline: none; max-height: 120px;
}
.mail-quick-reply-input:focus { border-color: var(--clr-primary-hover); }
.mail-quick-reply-wrap { display: flex; flex-direction: column; flex: 1; gap: 6px; }
.mail-quick-reply-row { display: flex; gap: 8px; align-items: flex-end; }

/* 첨부파일 칩 목록 - mail-compose.ejs의 .cmp-attach-list/.cmp-attach-chip과 동일(그 파일은
   자체 <style>에 인라인으로 갖고 있어 공유되지 않았으므로 여기 한 번 더 정의) - 빠른 회신
   첨부와 mail-compose 새 창 첨부가 시각적으로 항상 같은 모양이 되도록 함 */
.cmp-attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-attach-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 10px;
  background: #f1f5f9; border-radius: 6px; font-size: .75rem; color: #334155;
}
.cmp-attach-chip button { border: none; background: none; cursor: pointer; color: #94a3b8; display: flex; padding: 0; }
.cmp-attach-chip button:hover { color: #ef4444; }

/* editor-panel-header의 "인쇄" 아이콘 - 메일 본문(editor-panel-body/mail-view 페이지의
   본문 영역)만 남기고 나머지(사이드바/목록/헤더 아이콘 등)는 인쇄 결과에서 숨긴다. */
@media print {
  body * { visibility: hidden; }
  .editor-panel-body, .editor-panel-body * { visibility: visible; }
  .editor-panel-body { position: absolute; left: 0; top: 0; width: 100%; padding: 0; }
}

/* =============================================================
   메일 타임라인 - portal.smartertools.co.kr/mail 실제 디자인을 그대로 포팅(참고: 이미
   그 디자인을 이식 완료한 자매앱 freeitm_webmail의 .tl-*/.pp2-* 실제 CSS/마크업,
   mail-body.ejs 221번째 줄 주석 "참조: portal.smartertools.co.kr mail.ejs"로 확인됨).
   헤더 부분(.pp2-head 상당)만 다른 페이지들과의 명명 통일을 위해 .preview-header(-row)로
   개명함 - 그 아래 아바타/이름/이메일 등 나머지는 여전히 mail-tl-* 접두 그대로 사용. ============================================================= */
.preview-header { padding: 10px; border-bottom: 1px solid var(--clr-border); } /* 내용이 가장자리에 붙지 않도록 사방 10px 여백 */
.preview-header-row { display: flex; align-items: center; gap: 10px; }
.mail-tl-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.mail-tl-name { font-size: 13px; font-weight: 700; color: #111827; word-break: break-all; line-height: 1.4; }
.mail-tl-email { font-size: 11px; color: #9ca3af; word-break: break-all; margin-top: 2px; }
.mail-tl-summary { font-size: 11.5px; color: #6b7280; margin-top: 10px; }

.mail-tl-body { padding: 8px 0; }
.mail-tl-month-group { margin: 0 16px 6px; }
.mail-tl-month-label {
  font-size: 11px; font-weight: 600; color: #bbb; letter-spacing: .04em;
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.mail-tl-month-label::after { content: ''; flex: 1; height: 1px; background: #eee; }

.mail-tl-items { position: relative; padding-left: 22px; padding-bottom: 6px; }
.mail-tl-items::before {
  content: ''; position: absolute; left: 6px; top: 8px; bottom: 0; width: 2px;
  background: #e8ecf0; border-radius: 1px;
}
.mail-tl-item {
  position: relative; padding: 9px 10px; border-radius: 8px; cursor: pointer;
  transition: background .12s; margin-bottom: 2px;
}
.mail-tl-item:last-child { margin-bottom: 0; }
.mail-tl-item:hover { background: #f5f7fa; }
.mail-tl-item--active { background: #e8f0fe !important; }
.mail-tl-item::before {
  content: ''; position: absolute; left: -19px; top: 13px; width: 9px; height: 9px;
  border-radius: 50%; border: 2px solid #fff;
}
.mail-tl-item.mail-tl-received::before { background: #1a73e8; box-shadow: 0 0 0 1.5px #1a73e8; }
.mail-tl-item.mail-tl-sent::before { background: #10b981; box-shadow: 0 0 0 1.5px #10b981; }
.mail-tl-item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.mail-tl-dir-badge { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.mail-tl-received .mail-tl-dir-badge { background: #e8f0fe; color: #1a73e8; }
.mail-tl-sent .mail-tl-dir-badge { background: #d1fae5; color: #059669; }
.mail-tl-item-date { font-size: 11px; color: #bbb; margin-left: auto; flex-shrink: 0; }
.mail-tl-item-subject { font-size: 12px; font-weight: 600; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 대시보드 (/dashboard) ────────────────────────────────────────────
   기존 변수(--clr-*)와 컴포넌트(.card-item, .list-item, .list-panel,
   .badge, .empty)를 재사용하고, 배치용 클래스만 dash- 접두어로 추가한다. */
.dash-body { display: flex; flex-direction: column; gap: 28px; }
.dash-section { display: flex; flex-direction: column; gap: 10px; }
.dash-section-head { display: flex; align-items: baseline; justify-content: space-between; }
.dash-section-title { font-size: .9375rem; font-weight: 700; color: var(--clr-text); margin: 0; }
.dash-more { font-size: .8125rem; color: var(--clr-text-sub); text-decoration: none; }
.dash-more:hover { text-decoration: underline; }

/* 수치 요약 */
.dash-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.dash-stat {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  background: #fff; border: 1px solid var(--clr-border, #e2e8f0); border-radius: 10px;
}
.dash-stat-num { font-size: 1.5rem; font-weight: 700; color: var(--clr-text); line-height: 1.2; }
.dash-stat-label { font-size: .8125rem; color: var(--clr-text-sub); }

/* 빠른 만들기 카드 */
.dash-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.dash-card {
  gap: 6px; padding: 18px 20px; background: #fff;
  border: 1px solid var(--clr-border, #e2e8f0); border-radius: 10px;
}
.dash-card-ico {
  width: 36px; height: 36px; border-radius: 8px; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .9375rem;
}

/* 3단 배치 - 받은 편지함 · 일정 · 최근 활동을 한 줄에. 좁아지면 2단 → 1단 */
/* minmax(0,1fr) 이라야 칸이 내용 폭에 밀리지 않는다 — 그냥 1fr 이면 제목이 긴 목록이
   자기 칸을 넓혀 옆 칸을 찌그러뜨린다(실측: 649/213/705). */
.dash-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: stretch; }
@media (max-width: 1400px) { .dash-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .dash-columns { grid-template-columns: minmax(0, 1fr); } }

/* 대시보드 목록 패널은 카드다 — 원래 .list-panel 은 목록+편집기 2단 레이아웃용이라
   width:280px; flex-shrink:0 으로 고정돼 있어 칸을 채우지 못했다. 여기서만 폭을 푼다. */
.dash-section .list-panel {
  width: 100%; flex-shrink: 1; min-width: 0;
  border: 1px solid var(--clr-border, #e2e8f0); border-radius: 10px;
}
.dash-section .list-panel-body { width: 100%; }

/* 목록 행 */
.dash-row { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.dash-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-row-main .list-item-title,
.dash-row-main .list-item-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-main .list-item-title.is-strong { font-weight: 700; }
.dash-when { font-size: .75rem; color: var(--clr-text-sub); white-space: nowrap; }
.dash-time { font-size: .75rem; color: var(--clr-text-sub); white-space: nowrap; min-width: 74px; }
.dash-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: 0 0 auto; }
.dash-dot.is-unread { background: var(--clr-primary, #2563eb); }
.dash-group {
  font-size: .75rem; font-weight: 700; color: var(--clr-text-sub);
  padding: 10px 12px 4px; letter-spacing: .02em;
}
.dash-tag {
  font-size: 11px; font-weight: 700; color: #fff; border-radius: 5px;
  padding: 2px 8px; white-space: nowrap; flex: 0 0 auto;
}


/* ── 주/일 보기 시간대 그리드 (calendar.js renderTimeGrid) - 업무 시간(/mysetting/calendar)은 흰색, 그 외 시간은 회색 ── */
.cal-week .cal-week-head, .cal-day .cal-week-head { position: sticky; top: 0; background: #fff; z-index: 2; }
.cal-time-body { display: flex; flex-direction: column; }
.cal-hour-row .cal-time-gutter { transform: none; padding-top: 3px; }
.cal-hour-row.cal-off-hours { background: #f3f4f6; }
.cal-hour-row.cal-off-hours .cal-time-gutter { color: #a1a1aa; }
.cal-hour-row.cal-off-hours .cal-week-cell, .cal-hour-row.cal-off-hours .cal-day-cell-full { border-left-color: #e5e7eb; }
.cal-hour-row .cal-week-cell, .cal-hour-row .cal-day-cell-full { cursor: pointer; }
.cal-hour-row .cal-week-cell:hover, .cal-hour-row .cal-day-cell-full:hover { background: rgba(37, 99, 235, .05); }
.cal-hour-row .cal-evt-pill { margin-bottom: 2px; padding: 3px 6px; font-size: .6875rem; }
.cal-allday-row { min-height: 36px; border-bottom: 1px solid var(--clr-border); background: #fff; }
.cal-allday-row .cal-time-gutter { padding-top: 8px; font-weight: 600; color: #64748b; }


/* ── 캘린더: 여러 날에 걸친 일정의 이어진 막대(레인 배치) + 미리보기 패널 (calendar.js) ── */
.cal-evt-bar, .cal-evt-pill { cursor: pointer; }
.cal-evt-slot { visibility: hidden; }
.cal-month .cal-day-cell { overflow: visible; }
.cal-evt-bar.cal-span { border-radius: 0; margin-left: -7px; margin-right: -7px; position: relative; z-index: 1; }
.cal-evt-bar.cal-span.cal-span-start { border-top-left-radius: 4px; border-bottom-left-radius: 4px; margin-left: 0; }
.cal-evt-bar.cal-span.cal-span-end { border-top-right-radius: 4px; border-bottom-right-radius: 4px; margin-right: 0; }
.cal-allday-row .cal-week-cell, .cal-allday-row .cal-day-cell-full { overflow: visible; }
.cal-evt-pill.cal-span { border-radius: 0; margin-left: -5px; margin-right: -5px; position: relative; z-index: 1; }
.cal-evt-pill.cal-span.cal-span-start { border-top-left-radius: 6px; border-bottom-left-radius: 6px; margin-left: 0; }
.cal-evt-pill.cal-span.cal-span-end { border-top-right-radius: 6px; border-bottom-right-radius: 6px; margin-right: 0; }
.cal-preview-desc { padding: 4px 16px; font-size: 12.5px; line-height: 1.6; word-break: break-word; }
.cal-preview-desc img { max-width: 100%; }
.cal-preview-actions { display: flex; gap: 8px; padding: 10px 16px; }

/* 메일 목록: 보관 메일함으로 복사된(보관됨) 메일 표시 아이콘 (mail.js) */
.mail-archived-icon { flex-shrink: 0; color: #0d9488; margin-left: 4px; }

/* 주소록 보기 전환(목록/격자) 아이콘 - 현재 보기 강조 (contact.js) */
.contact-view-btn.active { color: var(--clr-primary); background: var(--nav-active-bg); }
#contactGridBody .example-grid { width: 100%; align-content: start; }
#contactGridBody .card-item { cursor: pointer; }

/* 주소록 상세(editor-panel-body / preview-panel) - preview-panel-row 라벨 폭을 연락처 항목명에 맞게 */
.contact-detail .preview-panel-row .k { width: 84px; }
/* 주소록 상세 머리글(.preview-header: 아바타·이름·회사·직책)은 preview-panel-header(#contactPreviewTitle) /
   editor-panel-header(#editorTitle) 안에 들어간다 - 헤더 높이는 내용에 맞게, 제목의 굵은 글씨는 상속하지 않음 */
.preview-header .mail-item-avatar { width: 40px; height: 40px; font-size: .85rem; margin-top: 0; }
.preview-header .mail-msg-subject { font-size: .95rem; margin-bottom: 2px; }
.preview-header .mail-meta-row { padding: 0; }
.editor-panel-title { flex: 1; min-width: 0; }
.editor-panel-header:has(.preview-header) { height: auto; min-height: 48px; padding: 10px 20px; }
.editor-panel-header .preview-header { padding: 0; border-bottom: none; font-weight: 400; }

/* 주소록 간단 메모 - editor-panel-footer 는 전역 감춤이지만 주소록 상세 하단의 메모 입력줄만 예외로 표시 */
.editor-panel-footer.contact-memo-footer:not([hidden]) { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; }
.contact-memo-footer .list-search-input { flex: 1; min-width: 0; }
.contact-memo-row { align-items: flex-start; }
.contact-memo-date { color: #9ca3af; width: 108px; flex-shrink: 0; font-size: 11.5px; padding-top: 1px; }
.contact-memo-body { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.contact-memo-empty { color: #9ca3af; padding: 4px 16px; font-size: 12.5px; }
.cn-del-btn { flex-shrink: 0; width: 26px; height: 26px; border: none; background: none; color: #9ca3af; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 5px; }
.cn-del-btn:hover { background: #fef2f2; color: #dc2626; }
.contact-memo-row .cn-del-btn { margin-left: auto; width: 22px; height: 22px; margin-top: -3px; }
/* 메일 타임라인 머리글(.preview-header)이 preview-panel-header(#mailTimelineTitle) 안에 들어갈 때 -
   자체 패딩/구분선은 헤더가 대신하고, 제목의 굵은 글씨는 상속하지 않으며 닫기 버튼은 오른쪽 위에 둔다 */
.preview-panel-title { min-width: 0; }
.preview-panel-header .preview-header { padding: 0; border-bottom: none; font-weight: 400; }
.preview-panel-header:has(.preview-header) { align-items: flex-start; }
.preview-panel-header .mail-tl-summary { margin-top: 8px; }


/* ── 활동 내역(/activity) ────────────────────────────────────────────
   그래프는 라이브러리 없이 인라인 SVG 로 그린다. 카드/여백은 대시보드(dash-)와 같은 결. */
.top_bar-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px; color: inherit; text-decoration: none;
  opacity: .85; transition: background .12s, opacity .12s;
}
.top_bar-icon-btn:hover { background: rgba(255,255,255,.12); opacity: 1; }
.act-select {
  height: 30px; padding: 0 10px; border: 1px solid var(--clr-border, #e2e8f0);
  border-radius: 6px; background: #fff; font-size: .8125rem; color: var(--clr-text, #1e293b);
}
.act-chart-card {
  background: #fff; border: 1px solid var(--clr-border, #e2e8f0); border-radius: 10px; padding: 16px 18px;
}
.act-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.act-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--clr-text-sub, #64748b); }
.act-legend-item i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.act-legend-item b { color: var(--clr-text, #1e293b); font-weight: 700; }
.act-legend-total { margin-left: auto; }
.act-chart { width: 100%; min-height: 172px; }
.act-svg { width: 100%; height: 172px; display: block; }


/* ── 새 문서 만들기 모달 ─────────────────────────────────────────────
   확장자는 고칠 수 없다는 걸 입력칸 옆에 붙여 보여 준다(입력값에는 안 들어간다). */
.nd-name-row { display: flex; align-items: center; gap: 8px; }
.nd-name-row .modal-input { flex: 1; min-width: 0; }
.nd-ext {
  flex: 0 0 auto; font-size: .8125rem; font-weight: 600; color: var(--clr-text-sub, #64748b);
  background: #f1f5f9; border: 1px solid var(--clr-border, #e2e8f0);
  border-radius: 6px; padding: 7px 10px;
}

/* 대시보드 목록 3종은 화면 높이를 채우고 안에서만 스크롤한다 */
.dash-columns { min-height: 0; }
.dash-section .list-panel { height: 100%; }
.dash-section .list-panel-body { max-height: none; }


/* ── 대시보드 목록 3종을 화면 높이에 맞춘다 ─────────────────────────────
   dash-body 는 원래 내용만큼 늘어나는 세로 스택이라 목록이 짧으면 아래가 비고 길면
   페이지가 늘어났다. 본문을 화면 높이에 묶고, 마지막 줄(목록 3종)만 남은 높이를
   가져가게 한 뒤 패널 안에서 스크롤한다. */
.dash-body { height: 100%; min-height: 0; box-sizing: border-box; }
.dash-body > .dash-columns { flex: 1; min-height: 0; }
.dash-columns > .dash-section { min-height: 0; }
.dash-section .list-panel { height: 100%; min-height: 0; }


/* ── 작업 상세(editor-panel-body) ────────────────────────────────────
   예전엔 `<p><strong>상태:</strong> 완료</p>` 를 그냥 쌓아 놔서 읽기 힘들었고,
   설명 HTML 은 이스케이프돼 태그가 글자로 보였다. 요약 배지 + 항목 그리드로 바꾼다. */
.tk-detail { display: flex; flex-direction: column; gap: 18px; padding: 4px 2px 8px; }
.tk-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-badge {
  font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px;
  background: #eef2f7; color: #475569;
}
.tk-badge.is-done { background: #dcfce7; color: #15803d; }
.tk-badge.is-progress { background: #dbeafe; color: #1d4ed8; }
.tk-badge.is-hold { background: #fef3c7; color: #b45309; }
.tk-badge.is-urgent { background: #fee2e2; color: #b91c1c; }
.tk-grid { display: grid; grid-template-columns: 88px 1fr; gap: 8px 14px; align-items: baseline; }
.tk-grid dt { font-size: 12px; color: #94a3b8; }
.tk-grid dd { margin: 0; font-size: 13px; color: #1e293b; word-break: break-word; }
.tk-progress { display: flex; align-items: center; gap: 10px; }
.tk-progress-bar { flex: 1; min-width: 0; height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.tk-progress-bar > span { display: block; height: 100%; background: var(--clr-primary, #2563eb); }
.tk-progress-num { font-size: 12px; color: #64748b; min-width: 34px; text-align: right; }
.tk-sec-title { font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 8px; }
.tk-desc { font-size: 13px; color: #1e293b; line-height: 1.65; word-break: break-word; }
.tk-desc img { max-width: 100%; }
.tk-desc:empty::after { content: attr(data-empty); color: #9ca3af; }

/* 체크리스트 */
.tk-check-list { display: flex; flex-direction: column; gap: 2px; }
.tk-check-row { display: flex; align-items: flex-start; gap: 9px; padding: 5px 4px; border-radius: 6px; }
.tk-check-row:hover { background: #f8fafc; }
.tk-check-row input[type="checkbox"] { margin-top: 2px; flex: 0 0 auto; }
.tk-check-body { flex: 1; min-width: 0; font-size: 13px; color: #1e293b; white-space: pre-wrap; word-break: break-word; }
.tk-check-row.is-done .tk-check-body { color: #9ca3af; text-decoration: line-through; }
.tk-check-empty { color: #9ca3af; font-size: 12.5px; padding: 4px 4px; }
.tk-check-row .cn-del-btn { flex: 0 0 auto; width: 22px; height: 22px; }
