/* 일정관리 모듈 — 좌측메뉴 + (달력 + to-do) + 상세 패널 */
.sch-layout { display: flex; align-items: flex-start; }

/* ---- 좌측 메뉴 ---- */
.sch-side {
    width: 200px; flex: 0 0 200px; background: #fff; border-right: 1px solid var(--line);
    padding: 16px 10px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
}
.sch-nav {
    display: flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 6px;
    color: #444; font-weight: 600; margin-bottom: 4px;
}
.sch-nav:hover { background: #f2f3f5; text-decoration: none; }
.sch-nav.active { background: #eaf1f7; color: #2f6aa8; }
.sch-badge {
    margin-left: auto; background: #ff5600; color: #fff; font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
}

.sch-main { flex: 1 1 auto; min-width: 0; }

/* ---- 목록 + 상세 패널 ---- */
.sch-listwrap {
    display: flex; gap: 0; align-items: stretch;
    max-width: 1100px; margin: 22px auto; padding: 0 24px; min-height: calc(100vh - 100px);
}
.sch-listwrap.has-detail .sch-listview {
    flex: 0 0 42%; max-width: 420px; border-right: 1px solid var(--line);
    padding-right: 20px; margin: 0;
}
.sch-listview { flex: 1 1 auto; max-width: 720px; margin: 22px auto; padding: 0 24px; }
.sch-listview .sch-title { margin: 0 0 14px; }
.sch-listview .todo-list { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; }
.todo-item .due { color: var(--muted); font-size: 12px; margin-left: 8px; }
.todo-item .myday, .todo-item .star-mark { margin-left: 6px; font-size: 12px; color: #f5a623; }
.todo-item.sel { background: #f0f6fc; border-radius: 6px; }
.todo-item.sel .txt a { font-weight: 700; color: #2f6aa8; }

.list-add { margin-bottom: 12px; }

.sch-month-events { max-width: 640px; }
.sch-month-events .sch-month-events-title { margin-top: 28px; }
.sch-month-sub { font-size: 15px; font-weight: 700; margin: 16px 0 8px; color: #333; }

.sch-wrap {
    display: flex; gap: 20px; align-items: flex-start;
    max-width: 1200px; margin: 22px auto; padding: 0 24px;
}

/* ---- 달력 ---- */
.sch-cal { flex: 1 1 auto; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.sch-cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sch-title { font-size: 20px; font-weight: 800; margin: 0; }
.sch-cal-head .today-btn { margin-left: auto; }

.sch-calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sch-calendar th {
    padding: 8px 0; font-size: 13px; color: #555; border-bottom: 2px solid var(--line);
}
.sch-calendar th.sun { color: #d94c4c; }
.sch-calendar th.sat { color: #3f6fd6; }

.sch-calendar td.daycell { height: 84px; vertical-align: top; border: 1px solid var(--line); padding: 0; }
.sch-calendar td.daycell > a {
    display: block; height: 100%; padding: 6px 8px; color: #333; position: relative;
}
.sch-calendar td.daycell > a:hover { background: #f5f8fc; text-decoration: none; }
.daycell .dnum { font-size: 13px; font-weight: 600; }
.daycell.sun .dnum { color: #d94c4c; }
.daycell.sat .dnum { color: #3f6fd6; }
/* 공휴일 — 일요일과 같은 빨강 + 이름 표기 */
.daycell.holiday .dnum { color: #d94c4c; }
.daycell .holi {
    display: block; margin-top: 2px; font-size: 10px; line-height: 1.15; color: #d94c4c;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.daycell.other > a { color: #bbb; background: #fafbfc; }
.daycell.other .dnum { color: #bbb; }
.daycell.today .dnum {
    background: #4a7fa8; color: #fff; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
}
.daycell.sel { outline: 2px solid #ff5600; outline-offset: -2px; }
.daycell .cnt {
    position: absolute; right: 6px; bottom: 6px;
    background: #ff5600; color: #fff; font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
/* 구글 캘린더 일정(읽기 전용) */
.daycell .gev {
    display: block; margin-top: 2px; font-size: 10px; line-height: 1.3;
    color: #1a73e8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%; padding-left: 8px; position: relative;
}
.daycell .gev::before {
    content: ''; position: absolute; left: 1px; top: 5px;
    width: 5px; height: 5px; border-radius: 50%; background: #1a73e8;
}
.daycell .gev-more { display: block; margin-top: 1px; font-size: 10px; color: #5f6b7a; padding-left: 8px; }
/* 이달 일정(on_calendar) 제목 표시 — 초록 점 + 말줄임 */
.daycell .tev {
    display: block; margin-top: 2px; font-size: 10px; line-height: 1.3; color: #0b7a3b;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
    padding-left: 8px; position: relative;
}
.daycell .tev::before {
    content: ''; position: absolute; left: 1px; top: 5px;
    width: 5px; height: 5px; border-radius: 50%; background: #0b9d4a;
}
.daycell .tev-more { display: block; margin-top: 1px; font-size: 10px; color: #5f6b7a; padding-left: 8px; }

/* ---- 할 일 패널(달력) ---- */
.sch-todo { flex: 0 0 340px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.sch-todo-title { font-size: 16px; margin: 0 0 12px; color: var(--ink); }
.sch-todo-title span { color: var(--muted); font-weight: 400; font-size: 14px; }
.sch-todo-title .sch-holi-tag { color: #d94c4c; font-weight: 600; font-size: 13px; }
/* 선택 날짜 패널 — 구글 일정 목록 */
.sch-gcal { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.sch-gcal-head { font-size: 13px; font-weight: 700; color: #1a73e8; margin-bottom: 6px; }
.sch-gcal ul { list-style: none; margin: 0; padding: 0; }
.sch-gcal li { font-size: 13px; color: #333; padding: 3px 0; padding-left: 12px; position: relative; }
.sch-gcal li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: #1a73e8; }
.sch-gcal .gt { color: #1a73e8; font-weight: 600; }

.todo-add { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.todo-add input[type=date] { height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.todo-add input[type=text] { flex: 1 1 120px; height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; min-width: 0; }

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.todo-item:last-child { border-bottom: none; }
.todo-item .chk {
    background: none; border: none; cursor: pointer; font-size: 16px; color: #4a7fa8; padding: 0; width: 22px;
}
.todo-item.done .chk { color: #0b9d4a; }
.todo-item .txt { flex: 1 1 auto; word-break: break-word; }
.todo-item.done .txt { text-decoration: line-through; color: var(--muted); }
.todo-item .star { background: none; border: none; cursor: pointer; font-size: 16px; color: #ccc; padding: 0 4px; }
.todo-item .star.on { color: #f5a623; }
.todo-item .del { background: none; border: none; color: #c0392b; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.todo-item .del:hover { color: #e74c3c; }
.todo-empty { color: var(--muted); padding: 16px 4px; text-align: center; }

/* ---- 상세 패널 (MS To Do 스타일) ---- */
.sch-detail {
    flex: 1 1 auto; background: #fff; border: 1px solid var(--line); border-radius: 10px;
    padding: 16px 20px; margin-left: 20px; min-width: 0;
}
.sch-detail-head {
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--muted); font-size: 13px;
}
.sch-detail-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px; font-size: 20px; color: #666;
}
.sch-detail-close:hover { background: #f2f3f5; text-decoration: none; }
.sch-detail-view { font-weight: 600; }

.sch-detail-title-row {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px;
}
.sch-detail-title-form { flex: 1 1 auto; min-width: 0; margin: 0; }
.sch-detail-title {
    width: 100%; border: none; font-size: 22px; font-weight: 700; padding: 4px 0;
    outline: none; background: transparent;
}
.sch-detail-title:focus { border-bottom: 1px solid #4a7fa8; }
.chk-lg, .star-lg {
    background: none; border: none; cursor: pointer; font-size: 22px; padding: 2px 0; line-height: 1;
}
.chk-lg { color: #4a7fa8; }
.star-lg { color: #ccc; }
.star-lg.on { color: #f5a623; }

.sch-step-add { margin: 8px 0 16px; font-size: 13px; }
.sch-step-add .soon, .sch-file-add .soon { color: #bbb; font-size: 11px; }

.sch-meta-list { list-style: none; margin: 0 0 20px; padding: 0; }
.sch-meta {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
    margin-bottom: 4px; font-size: 13px;
}
.sch-meta.on { background: #f5f8fc; color: #333; }
.sch-meta.on .ico { font-size: 15px; }
.sch-meta.on span:nth-child(2) { flex: 1 1 auto; }
.sch-meta.add { padding: 4px 0; }
.meta-form { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meta-add-btn {
    background: none; border: none; color: #4a7fa8; cursor: pointer; font-size: 13px; padding: 6px 8px;
    border-radius: 6px;
}
.meta-add-btn:hover { background: #f0f6fc; }
.meta-time, .meta-date, .meta-select {
    height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 12px; background: #fff;
}
.todo-item .recur-mark { margin-left: 6px; font-size: 12px; }

/* 새 할 일 추가 컴포저 (상세 입력 항목 + 추가 버튼) */
.todo-add-full { display: block; margin-bottom: 14px; }
.todo-add-full .add-title {
    width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 6px;
    padding: 0 10px; margin-bottom: 8px; box-sizing: border-box; font-size: 14px;
}
.add-opts { list-style: none; margin: 0 0 8px; padding: 0; }
.add-opts li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #444; padding: 4px 0; flex-wrap: wrap; }
.add-opt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.add-ico { font-size: 14px; }
.add-note {
    width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px;
    font-family: inherit; font-size: 13px; resize: vertical; box-sizing: border-box;
}
.add-actions { display: flex; gap: 8px; margin-top: 2px; }
.add-actions .btn { flex: 1; justify-content: center; height: 38px; }
.add-actions .btn[disabled] { opacity: .45; cursor: not-allowed; }
.sch-del-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sch-del-box .del-label { font-size: 12px; color: var(--muted); }
.sch-del-box .del-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #444; cursor: pointer; }
.sch-del-box .btn.danger { margin-left: auto; }

/* 달력 선택 날짜 패널 안의 상세 패널 (좁은 폭용) */
.sch-cal-detail { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 6px; }
.sch-cal-detail .sch-detail { border: none; border-radius: 0; padding: 0; margin-left: 0; box-shadow: none; }
.meta-x {
    background: none; border: none; color: #999; cursor: pointer; font-size: 16px; padding: 0 4px; line-height: 1;
}
.meta-x:hover { color: #c0392b; }

.sch-detail-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.sch-file-add { margin: 0 0 10px; font-size: 13px; }
.sch-note-form textarea {
    width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px;
    font-family: inherit; font-size: 13px; resize: vertical; min-height: 80px;
}
.sch-note-form textarea:focus { outline: none; border-color: #4a7fa8; }
.sch-delete-form { margin-top: 12px; }

@media (max-width: 900px) {
    .sch-listwrap { flex-direction: column; }
    .sch-listwrap.has-detail .sch-listview {
        flex: 1 1 auto; max-width: none; border-right: none; padding-right: 0;
        border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px;
    }
    .sch-detail { margin-left: 0; }
}

@media (max-width: 760px) {
    .sch-wrap { flex-direction: column; }
    .sch-todo { flex: 1 1 auto; width: 100%; }
}
