/* labnote.css - Lab 노트 (원포인트 업무 허브) */
/* 교수님 초안(test.html)의 2단 트리+텍스트창 양식 준용. 색/버튼은 worklog와 동일한 인디고 계열. */

#lnApp {
    --ln-bg: #f4f5f7; --ln-card: #ffffff; --ln-ink: #1f2328; --ln-sub: #6b7280;
    --ln-line: #e5e7eb; --ln-accent: #4f46e5; --ln-soft: #eef2ff;
    --ln-ok: #059669; --ln-warn: #d97706; --ln-danger: #dc2626;
    max-width: 1200px; margin: 0 auto; padding: 0 4px 40px;
}

/* ===== 2단 레이아웃 ===== */
.ln-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .ln-layout { grid-template-columns: 1fr; } }

.ln-menu { background: var(--ln-card); border: 1px solid var(--ln-line); border-radius: 14px; padding: 10px; position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
@media (max-width: 860px) { .ln-menu { position: static; max-height: none; } }
.ln-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.ln-menu-head span { font-size: 13px; font-weight: 800; color: var(--ln-sub); }
.ln-menu-add { border: none; background: var(--ln-soft); color: var(--ln-accent); font-weight: 800; font-size: 12px; border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.ln-menu-add:hover { background: #e0e7ff; }
.ln-menu-empty { padding: 12px 8px; font-size: 12.5px; color: var(--ln-sub); }

/* 메뉴 하단 고정 (캘린더 / Drive) */
.ln-menu-bottom { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--ln-line); }
.ln-fixed-row { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 9px; cursor: pointer; font-size: 13.5px; font-weight: 800; color: #374151; text-decoration: none; }
.ln-fixed-row:hover { background: #f4f5fb; }
.ln-fixed-row.active { background: var(--ln-soft); color: var(--ln-accent); }
.ln-fixed-row i { width: 16px; text-align: center; color: var(--ln-accent); }
.ln-fixed-row .ln-ext { width: auto; margin-left: auto; font-size: 10px; color: var(--ln-sub); }

/* ===== 트리 행 공통 ===== */
.ln-row { display: flex; align-items: center; gap: 6px; border-radius: 8px; cursor: pointer; position: relative; }
.ln-row:hover { background: #f4f5fb; }
.ln-row.active { background: var(--ln-soft); }
.ln-row .caret { font-size: 10px; color: var(--ln-sub); transition: transform .15s; width: 12px; text-align: center; flex: none; }
.ln-row.open > .caret { transform: rotate(90deg); }
.ln-row .label { flex: 1; word-break: break-word; min-width: 0; }
.ln-row .label .fa-external-link-alt { font-size: 10px; color: var(--ln-sub); margin-left: 4px; }
.ln-row .cnt { font-size: 10px; font-weight: 700; color: var(--ln-sub); background: #f0f1f5; border-radius: 10px; padding: 1px 6px; flex: none; }
.ln-row.active .cnt { color: var(--ln-accent); background: #fff; }
.ln-kebab { flex: none; border: none; background: none; color: var(--ln-sub); font-size: 15px; font-weight: 800; width: 22px; height: 22px; border-radius: 6px; cursor: pointer; opacity: 0; line-height: 1; }
.ln-row:hover .ln-kebab, .ln-row.active .ln-kebab { opacity: 1; }
.ln-kebab:hover { background: #e5e7eb; color: var(--ln-ink); }

.ln-g-head { padding: 7px 6px 7px 8px; font-weight: 800; font-size: 14px; }
.ln-g-head .dotc { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ln-i-head { padding: 5px 6px 5px 8px; font-weight: 700; font-size: 13px; color: #374151; }
.ln-s-head { padding: 5px 6px 5px 8px; font-size: 12.5px; color: #4b5563; }

.ln-children-g { display: none; margin: 2px 0 4px 12px; padding-left: 8px; border-left: 1px solid var(--ln-line); }
.ln-grp.open > .ln-children-g { display: block; }
.ln-children-i { display: none; margin: 1px 0 4px 10px; padding-left: 8px; border-left: 1px dashed var(--ln-line); }
.ln-itm.open > .ln-children-i { display: block; }

.ln-rename { flex: 1; font: inherit; font-size: 13px; border: 1px solid var(--ln-accent); border-radius: 6px; padding: 2px 6px; outline: none; min-width: 0; }

/* 드래그 순서변경 */
.ln-row.dragging { opacity: .4; }
.ln-row.drop-before { box-shadow: inset 0 2px 0 var(--ln-accent); }
.ln-row.drop-after { box-shadow: inset 0 -2px 0 var(--ln-accent); }
.ln-row.drop-into { background: var(--ln-soft); outline: 1px dashed var(--ln-accent); outline-offset: -1px; }

/* ===== 팝업(...) 메뉴 ===== */
.ln-popmenu { position: fixed; z-index: 3000; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 5px; min-width: 168px; display: none; }
.ln-popmenu button { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: #1f2328; }
.ln-popmenu button:hover { background: #f4f5fb; }
.ln-popmenu button.danger { color: #dc2626; }
.ln-popmenu button.danger:hover { background: #fef2f2; }
.ln-popmenu .sep { height: 1px; background: #e5e7eb; margin: 4px 2px; }

/* ===== 우측 본문 ===== */
.ln-body { background: var(--ln-card); border: 1px solid var(--ln-line); border-radius: 14px; padding: 20px 22px; min-height: 420px; min-width: 0; }
.ln-crumb { font-size: 12px; font-weight: 700; color: var(--ln-sub); margin-bottom: 8px; }
.ln-title { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ln-line); color: var(--ln-ink); }
.ln-placeholder { color: var(--ln-sub); font-size: 14px; padding: 80px 0; text-align: center; }

/* 서식 툴바 */
.ln-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 10px; padding: 7px 8px; background: #f7f8fb; border: 1px solid var(--ln-line); border-radius: 10px; }
.ln-tb { border: 1px solid var(--ln-line); background: #fff; color: var(--ln-ink); font-size: 13px; font-weight: 700; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; cursor: pointer; }
.ln-tb:hover { background: var(--ln-soft); border-color: var(--ln-accent); }
.ln-tb.swatch { width: 24px; min-width: 24px; padding: 0; font-size: 0; }
.ln-tb-sel { border: 1px solid var(--ln-line); background: #fff; color: var(--ln-ink); font-size: 12.5px; font-weight: 700; height: 30px; border-radius: 7px; cursor: pointer; padding: 0 4px; }
.ln-sep { width: 1px; height: 20px; background: var(--ln-line); margin: 0 3px; }
.ln-lbl { font-size: 11px; font-weight: 700; color: var(--ln-sub); margin: 0 2px; }
.ln-tb.date-btn { color: var(--ln-accent); border-color: #c7d2fe; background: var(--ln-soft); }
.ln-tb.date-btn:hover { background: #e0e7ff; }

/* 텍스트 편집창 */
.ln-editor { width: 100%; min-height: 320px; font-family: inherit; font-size: 15px; color: #374151; line-height: 1.7; border: 1px solid var(--ln-line); border-radius: 10px; padding: 12px 14px; background: #fff; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.ln-editor:focus { outline: none; border-color: var(--ln-accent); box-shadow: 0 0 0 3px var(--ln-soft); }
.ln-editor:empty:before { content: attr(data-ph); color: #9ca3af; }

/* 링크 항목 본문 (바로가기 카드 — 클릭 시 해당 링크로 이동) */
.ln-linkbox { padding: 40px 0; text-align: center; color: var(--ln-sub); font-size: 14px; }
.ln-linkbox a { display: inline-block; margin-top: 12px; background: var(--ln-accent); color: #fff; font-weight: 800; font-size: 14px; padding: 10px 22px; border-radius: 9px; text-decoration: none; }
.ln-linkbox a:hover { background: #4338ca; }
.ln-linkbox .url { display: block; margin-top: 10px; font-size: 12px; color: #9ca3af; word-break: break-all; }

/* ===== Lab 캘린더 ===== */
.ln-cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.ln-cal-head h2 { font-size: 19px; font-weight: 800; color: var(--ln-ink); min-width: 132px; text-align: center; }
.ln-cal-nav { border: 1px solid var(--ln-line); background: #fff; width: 30px; height: 30px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--ln-ink); }
.ln-cal-nav:hover { background: var(--ln-soft); border-color: var(--ln-accent); }
.ln-cal-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ln-sub); align-items: center; }
.ln-cal-legend .lg { display: inline-flex; align-items: center; gap: 4px; }
.ln-cal-legend .lg i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ln-cal-hint { font-size: 12px; color: var(--ln-sub); margin-bottom: 8px; }

.ln-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ln-cal th { font-size: 12px; font-weight: 800; color: var(--ln-sub); padding: 6px 4px; border: 1px solid var(--ln-line); background: #f7f8fb; }
.ln-cal th.sun { color: #dc2626; }
.ln-cal th.sat { color: #2563eb; }
.ln-cal td { border: 1px solid var(--ln-line); vertical-align: top; height: 92px; padding: 4px; cursor: pointer; }
.ln-cal td:hover { background: #f7f8fd; }
.ln-cal td.out { background: #fafafa; }
.ln-cal td.out .dnum { color: #c3c8d0; }
.ln-cal .dnum { font-size: 12px; font-weight: 800; color: #374151; display: inline-block; min-width: 20px; text-align: center; border-radius: 10px; padding: 1px 2px; }
.ln-cal td.sun .dnum { color: #dc2626; }
.ln-cal td.sat .dnum { color: #2563eb; }
.ln-cal td.today .dnum { background: var(--ln-accent); color: #fff; }
.ln-ev { display: block; font-size: 11px; font-weight: 700; color: #fff; border-radius: 5px; padding: 1px 5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ln-ev:hover { filter: brightness(.92); }
.ln-ev-more { display: block; font-size: 10.5px; font-weight: 700; color: var(--ln-sub); margin-top: 2px; }

/* 일정 팝오버 */
.ln-evpop { position: fixed; z-index: 3000; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 13px 14px; width: 250px; display: none; }
.ln-evpop h4 { font-size: 13px; font-weight: 800; color: #1f2328; margin-bottom: 9px; }
.ln-evpop input[type="text"], .ln-evpop input[type="date"], .ln-evpop select { width: 100%; font: inherit; font-size: 13px; border: 1px solid #e5e7eb; border-radius: 7px; padding: 6px 8px; margin-bottom: 7px; }
.ln-evpop input:focus, .ln-evpop select:focus { outline: none; border-color: #4f46e5; }
.ln-evpop .ev-actions { display: flex; gap: 6px; margin-top: 2px; }
.ln-evpop .ev-actions .wl-btn { padding: 6px 11px; font-size: 12.5px; }
.ln-evpop .ev-del { margin-right: auto; color: #dc2626; }

@media (max-width: 600px) {
    .ln-body { padding: 14px 12px; }
    .ln-cal td { height: 70px; }
}
