/* =============================================================================
 * 기본 요소 스타일
 * ============================================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

/* =============================================================================
 * 네비게이션 메뉴 스타일
 * ============================================================================= */
.nav-container {
    background-color: #333;
    width: 100%;
    margin-bottom: 20px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.3s;
}

.nav-menu li a:hover {
    background-color: #555;
}

/* 현재 페이지 표시 */
.nav-menu li a.active {
    background-color: #2196F3;
    font-weight: bold;
}

/* 관리자 버튼 */
.btn-admin {
    background-color: #555;
    color: #ccc;
    border: 1px solid #777;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
    margin-left: 8px;
}

.btn-admin:hover {
    background-color: #666;
    color: #fff;
}

.btn-admin.admin-active {
    background-color: #1976d2;
    color: #fff;
    border-color: #1565c0;
}

/* =============================================================================
 * 미디어 쿼리
 * ============================================================================= */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu li {
        margin-bottom: 10px;
    }
}

/* 예약 알림 토스트 (자동 사라짐 없음 — 클릭 또는 ✕로 닫기) */
.reservation-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #ffffff;
    border: 1.5px solid #c5d3e0;
    border-left: 4px solid #3182f6;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 16px 40px 16px 20px;
    min-width: 280px;
    max-width: 360px;
    z-index: 9999;
    animation: toast-in 0.3s ease;
    cursor: pointer;
}

.reservation-toast .toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #8b95a1;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.reservation-toast .toast-close:hover {
    background: #f2f4f6;
    color: #333d4b;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: #3182f6;
    margin-bottom: 6px;
}

.toast-body {
    font-size: 13px;
    color: #6b7684;
    line-height: 1.5;
    word-break: break-all;
    white-space: normal;
}

.toast-hide {
    animation: toast-out 0.4s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(16px); }
}

/* =============================================================================
 * 업무 메모 FAB 버튼 (우상단 네비게이션 옆)
 * ============================================================================= */
#memoFabBtn {
    position: fixed;
    top: 8px;
    right: 16px;
    width: auto;
    height: auto;
    border-radius: 8px;
    background: #3182f6;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border: none;
    box-shadow: 0 2px 8px rgba(49, 130, 246, 0.3);
    cursor: pointer;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

#memoFabBtn:hover {
    background: #1c6ef3;
}

#memoBadge {
    display: none;
    position: absolute;
    top: -7px;
    right: -7px;
    background: #f04452;
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 3px;
    pointer-events: none;
    box-shadow: 0 0 0 2px #3182f6;
}

/* =============================================================================
 * 업무 메모 팝업 오버레이
 * ============================================================================= */
#memoPopup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 9100;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 48px;
}

#memoPopup.open {
    display: flex;
}

/* 청소·캘린더 등 페이지의 전역 button/input 규칙이 메모 팝업까지 적용되는 것 방지 */
#memoPopup button {
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

/* 전역 button의 큰 padding(예: cleaning.css) 무력화 */
#memoPopup #taskAddBtn {
    padding: 9px 16px;
}

#memoPopup .task-cancel-edit {
    padding: 9px 14px;
}

#memoPopup #memoCloseBtn {
    padding: 0;
    background: none;
    color: #8b95a1;
}

#memoPopup .memo-tab {
    flex: 1 1 0;
    min-width: 0;
    padding: 6px 0;
}

#memoPopup .memo-meta-row {
    min-width: 0;
}

#memoPopup .memo-meta-row input {
    min-width: 0;
    flex: 1 1 0;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

#memoPopup #taskInput {
    min-width: 0;
    max-width: 100%;
    width: auto;
    box-sizing: border-box;
}

#memoPopup #taskAddBtn,
#memoPopup .task-cancel-edit {
    flex-shrink: 0;
}

#memoPopup .done-search-row input {
    min-width: 0;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
}

#memoPopup .task-del {
    width: auto;
    padding: 0 2px;
}

.memo-panel {
    background: #fff;
    border-radius: 16px;
    width: 380px;
    margin-right: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.16);
    padding: 20px 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 64px);
    animation: panel-in 0.22s ease;
}

@keyframes panel-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.memo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.memo-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #191f28;
}

#memoCloseBtn {
    background: none;
    border: none;
    font-size: 18px;
    color: #8b95a1;
    cursor: pointer;
    line-height: 1;
}

/* 탭 */
.memo-tabs {
    display: flex;
    gap: 4px;
    background: #f2f4f6;
    border-radius: 10px;
    padding: 3px;
}

.memo-tab {
    flex: 1;
    padding: 6px 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: #8b95a1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.memo-tab.active {
    background: #fff;
    color: #191f28;
    font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* 추가 영역 */
.memo-add-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.memo-meta-row {
    display: flex;
    gap: 8px;
}

.memo-meta-row input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #d0d7e0;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    outline: none;
    background: #fff;
}

.memo-meta-row input:focus {
    border-color: #3182f6;
}

.memo-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

#taskInput {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #d0d7e0;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    outline: none;
}

#taskInput:focus {
    border-color: #3182f6;
}

#taskAddBtn {
    padding: 9px 16px;
    background: #3182f6;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

#taskAddBtn:hover {
    background: #1c6ef3;
}

.task-cancel-edit {
    display: none;
    padding: 9px 14px;
    background: #f2f4f6;
    color: #4e5968;
    border: 1px solid #d0d7e0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.task-cancel-edit:hover {
    background: #e8ecf0;
    border-color: #c5cdd8;
}

/* 완료 탭 검색 */
#doneSearchArea {
    display: none;
}

.done-search-row {
    display: flex;
    gap: 8px;
}

.done-search-row input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d0d7e0;
    border-radius: 10px;
    font-size: 13px;
    color: #333;
    outline: none;
    min-width: 0;
    box-sizing: border-box;
}

.done-search-row input:focus {
    border-color: #3182f6;
}

#taskList {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-empty {
    text-align: center;
    color: #8b95a1;
    font-size: 14px;
    padding: 16px 0;
}

.task-group-label {
    font-size: 11px;
    font-weight: 700;
    color: #8b95a1;
    letter-spacing: 0.04em;
    padding: 6px 2px 4px;
    border-bottom: 1px solid #eaeef2;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f9fafb;
    border: 1px solid #eaeef2;
    border-radius: 12px;
    padding: 10px 12px;
    transition: opacity 0.2s;
}

.task-item.done {
    opacity: 0.55;
}

.task-item.done .task-content {
    text-decoration: line-through;
    color: #8b95a1;
}

.task-check input[type="checkbox"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: #3182f6;
    margin-top: 3px;
    flex-shrink: 0;
}

.task-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.task-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.task-badge-date {
    display: inline-block;
    background: #eef4ff;
    color: #3182f6;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.task-badge-room {
    display: inline-block;
    background: #fff4e6;
    color: #c96f00;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

.task-badge-author {
    display: inline-block;
    background: #f0f0f5;
    color: #6b7684;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

.task-content {
    font-size: 13px;
    color: #191f28;
    line-height: 1.45;
}

.task-del {
    background: none;
    border: none;
    color: #c9cdd4;
    font-size: 13px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

.task-del:hover {
    color: #f04452;
}

/* =============================================================================
 * 업무 메모 전용 페이지 (/memo) — 홈 팝업과 동일 API·동작, 전체 화면 레이아웃
 * ============================================================================= */
body.memo-page {
    min-height: 100vh;
}

.memo-page-main {
    padding-bottom: 56px;
}

body.memo-page #memoPopup.memo-page-root {
    display: flex;
    position: static;
    inset: auto;
    background: transparent;
    padding: 24px 16px 40px;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 52px);
}

body.memo-page #memoPopup.memo-page-root .memo-panel {
    width: 100%;
    max-width: 720px;
    margin-right: 0;
    max-height: none;
    min-height: min(560px, calc(100vh - 120px));
    animation: none;
}

body.memo-page #memoPopup #memoCloseBtn {
    font-size: 14px;
    font-weight: 600;
    color: #3182f6;
}

.memo-page-user-info {
    position: fixed;
    bottom: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 13px;
    z-index: 100;
}