/* ===================================================================
   Notion 스타일 테마 (기존 CSS 뒤에 로드되어 덮어씀)
   =================================================================== */

:root {
    --n-text: #37352f;
    --n-text-secondary: #787774;
    --n-text-faint: #9b9a97;
    --n-bg: #ffffff;
    --n-sidebar-bg: #f7f7f5;
    --n-hover: rgba(0, 0, 0, 0.045);
    --n-active: rgba(0, 0, 0, 0.08);
    --n-border: #e9e9e7;
    --n-blue: #2383e2;
    --n-blue-hover: #1b74ca;
    --n-blue-soft: rgba(35, 131, 226, 0.12);
    --n-red: #eb5757;
    --n-shadow-card: rgba(15, 15, 15, 0.03) 0 0 0 1px, rgba(15, 15, 15, 0.04) 0 2px 4px;
    --n-shadow-modal: rgba(15, 15, 15, 0.05) 0 0 0 1px, rgba(15, 15, 15, 0.1) 0 5px 10px, rgba(15, 15, 15, 0.2) 0 15px 40px;
}

body {
    background-color: var(--n-bg);
    color: var(--n-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 얇은 스크롤바 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #d3d1cb;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #aeaca6;
}

/* ============ 사이드바: 어두운 남색 → Notion 라이트 ============ */
.sidebar {
    background: var(--n-sidebar-bg);
    color: var(--n-text);
    border-right: 1px solid var(--n-border);
}

.sidebar-header {
    border-bottom: none;
    padding: 18px 16px 8px;
}

.sidebar-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--n-text-secondary);
    letter-spacing: 0.03em;
}

.toggle-btn {
    color: var(--n-text-secondary);
    font-size: 18px;
    border-radius: 4px;
    padding: 2px 6px;
}

.toggle-btn:hover {
    background: var(--n-hover);
}

.sidebar-menu {
    padding: 4px 8px;
}

.sidebar-menu a {
    color: var(--n-text);
    padding: 7px 12px;
    margin: 1px 0;
    border-radius: 6px;
    font-size: 14.5px;
    font-weight: 500;
    transition: background 0.1s;
}

.sidebar-menu a:hover {
    background: var(--n-hover);
}

.sidebar-menu a.active {
    background: var(--n-active);
    font-weight: 600;
}

.user-info {
    border-top: 1px solid var(--n-border);
    padding: 14px 16px;
    font-size: 14px;
    color: var(--n-text-secondary);
}

.user-info button {
    background: transparent;
    color: var(--n-text-secondary);
    border: 1px solid var(--n-border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    transition: all 0.15s;
}

.user-info button:hover {
    background: var(--n-hover);
    color: var(--n-red);
    border-color: var(--n-red);
}

/* 모바일 메뉴 버튼/닫기 X — 라이트 테마에 맞게 */
.mobile-menu-toggle {
    background: #ffffff;
    color: var(--n-text);
    border: 1px solid var(--n-border);
    box-shadow: var(--n-shadow-card);
}

.mobile-menu-toggle:hover {
    background: var(--n-sidebar-bg);
}

@media (max-width: 768px) {
    .sidebar-header::after {
        color: var(--n-text-secondary);
    }
}

/* ============ 메인 콘텐츠 / 제목 ============ */
.main-content {
    padding: 36px 48px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1,
.page > h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page > h1 {
    margin-bottom: 24px;
}

/* ============ 버튼 ============ */
.btn-primary {
    background: var(--n-blue);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: var(--n-blue-hover);
}

.btn-danger {
    background: transparent;
    color: var(--n-red);
    border: 1px solid var(--n-red);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
}

.btn-danger:hover {
    background: var(--n-red);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--n-text-secondary);
    border: 1px solid var(--n-border);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: var(--n-hover);
}

/* ============ 카드류: 그림자 → 얇은 보더의 플랫 카드 ============ */
.dashboard-section,
.board-list,
.calendar,
.memo-list,
.memo-content,
.detail-container,
.form-container,
.admin-users-list {
    box-shadow: none;
    border: 1px solid var(--n-border);
    border-radius: 10px;
    background: var(--n-bg);
}

.dashboard-section h2 {
    color: var(--n-text);
    font-size: 16px;
    font-weight: 600;
}

.summary-item {
    background: transparent;
    border-radius: 6px;
    transition: background 0.1s;
}

.summary-item:hover {
    background: var(--n-hover);
    transform: none;
}

.summary-item .meta,
.board-item .meta,
.memo-meta,
.detail-meta {
    color: var(--n-text-faint);
}

.board-item {
    border-bottom: 1px solid var(--n-border);
}

.board-item:last-child {
    border-bottom: none;
}

.board-item:hover {
    background: var(--n-hover);
}

.board-item .title {
    font-size: 16px;
}

/* 이슈 상태 뱃지 — Notion 태그 스타일 */
.issue-status {
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
}

.issue-status.resolved {
    background: #dbeddb;
    color: #1c3829;
}

.issue-status.pending {
    background: #ffe2dd;
    color: #93341f;
}

/* ============ 폼/입력 ============ */
.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--n-text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select,
.memo-search input {
    border: 1px solid var(--n-border);
    border-radius: 6px;
    font-size: 15px;
    color: var(--n-text);
    background: var(--n-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.memo-search input:focus {
    outline: none;
    border-color: var(--n-blue);
    box-shadow: 0 0 0 2px var(--n-blue-soft);
}

/* ============ 모달 ============ */
.modal {
    background-color: rgba(15, 15, 15, 0.55);
}

.modal-content {
    border-radius: 10px;
    box-shadow: var(--n-shadow-modal);
    padding: 28px;
    max-width: 680px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 7vh auto;
}

.modal-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.close {
    color: var(--n-text-faint);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    right: 14px;
    top: 14px;
}

.close:hover {
    background: var(--n-hover);
    color: var(--n-text);
}

/* ============ 페이지네이션 ============ */
.pagination button {
    border: 1px solid var(--n-border);
    border-radius: 6px;
    color: var(--n-text-secondary);
}

.pagination button:hover,
.pagination button.active {
    background: var(--n-blue);
    border-color: var(--n-blue);
    color: white;
}

/* ============ 캘린더 ============ */
.calendar-grid {
    background: var(--n-border);
    border: 1px solid var(--n-border);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day {
    border-color: var(--n-border);
}

.calendar-day.today {
    background: var(--n-blue-soft);
}

.calendar-day.today .day-number {
    background: var(--n-blue);
}

.calendar-day-header {
    background: var(--n-sidebar-bg);
    color: var(--n-text-secondary);
    font-size: 13px;
}

.calendar-header button {
    background: transparent;
    border: 1px solid var(--n-border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--n-text-secondary);
    transition: background 0.15s;
}

.calendar-header button:hover {
    background: var(--n-hover);
}

.schedule-item {
    background: var(--n-blue-soft);
    border-radius: 4px;
    color: var(--n-text);
}

.schedule-item:hover {
    background: rgba(35, 131, 226, 0.22);
}

/* ============ 주간 스케줄 ============ */
.schedule-week-wrapper {
    background: var(--n-sidebar-bg);
    border-radius: 8px;
}

.day-item {
    border: 1px solid var(--n-border) !important;
    border-radius: 8px;
}

.day-item.today {
    background: var(--n-blue-soft);
    border-color: var(--n-blue) !important;
    box-shadow: none;
}

.day-item.yesterday {
    background: #fbf3db;
    border-color: #dfab01 !important;
}

.day-label {
    background: var(--n-blue);
    border-radius: 4px;
}

.day-item.yesterday .day-label {
    background: #dfab01;
}

.schedule-item-mini {
    background: var(--n-blue-soft);
}

.today-schedules-detail,
.yesterday-schedules-detail {
    background: var(--n-sidebar-bg);
    border-radius: 8px;
}

.today-schedules-detail .schedule-item,
.yesterday-schedules-detail .schedule-item {
    border: 1px solid var(--n-border);
    box-shadow: none;
    border-radius: 6px;
}

/* ============ 메모: Notion 페이지 스타일 ============ */
.memo-container {
    height: calc(100vh - 210px);
    min-height: 480px;
}

.memo-list {
    padding: 8px;
    background: var(--n-sidebar-bg);
}

.memo-item {
    padding: 10px 12px;
    border-bottom: none;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: background 0.1s;
}

.memo-item:hover {
    background: var(--n-hover);
}

.memo-item.active {
    background: var(--n-active);
}

.memo-item .memo-title {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.memo-item .memo-date {
    font-size: 12px;
    color: var(--n-text-faint);
    margin-top: 2px;
}

.memo-content {
    padding: 36px 44px;
}

.memo-content h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.memo-meta {
    font-size: 13px;
    border-bottom: 1px solid var(--n-border);
    padding-bottom: 14px;
    margin-bottom: 20px;
}

.memo-body {
    line-height: 1.75;
    font-size: 15.5px;
}

.memo-actions {
    border-top: 1px solid var(--n-border);
}

/* ---- 메모 인라인 에디터 (팝업 대체) ---- */
.memo-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.memo-title-input {
    border: none;
    outline: none;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--n-text);
    padding: 0 0 12px;
    width: 100%;
    background: transparent;
    font-family: inherit;
}

.memo-title-input::placeholder {
    color: #d3d1cb;
}

.memo-editor .editor-toolbar {
    border-top: 1px solid var(--n-border);
    padding-top: 10px;
    margin-bottom: 10px;
}

.memo-body-input {
    flex: 1;
    min-height: 200px;
    border: none;
    outline: none;
    resize: none;
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--n-text);
    background: transparent;
    font-family: inherit;
    padding: 0;
}

.memo-body-input::placeholder {
    color: var(--n-text-faint);
}

.memo-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--n-border);
    margin-top: 14px;
}

.memo-editor-hint {
    font-size: 12px;
    color: var(--n-text-faint);
    margin-right: auto;
}

/* ============ 에디터 툴바/첨부 ============ */
.editor-toolbar .btn-attach {
    background: transparent;
    border: 1px solid var(--n-border);
    border-radius: 6px;
    color: var(--n-text-secondary);
}

.editor-toolbar .btn-attach:hover {
    background: var(--n-hover);
}

/* 에디터 안 이미지 미리보기 (저장 전에도 붙여넣은 이미지 표시) */
.editor-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    border-top: 1px dashed var(--n-border);
    margin-top: 10px;
}

.editor-image-preview img {
    max-height: 140px;
    max-width: 100%;
    border: 1px solid var(--n-border);
    border-radius: 8px;
    display: block;
}

.editor-image-preview a:hover img {
    box-shadow: var(--n-shadow-modal);
}

.content-file {
    background: var(--n-sidebar-bg);
    border: 1px solid var(--n-border);
    border-radius: 6px;
}

.content-file:hover {
    background: var(--n-hover);
}

.content-image {
    border: 1px solid var(--n-border);
    border-radius: 8px;
}

/* ============ 상세 페이지 ============ */
.detail-title {
    font-size: 30px;
    letter-spacing: -0.01em;
}

.detail-header {
    border-bottom: 1px solid var(--n-border);
}

.back-button {
    background: transparent;
    color: var(--n-text-secondary);
    border: 1px solid var(--n-border);
}

.back-button:hover {
    background: var(--n-hover);
    color: var(--n-text);
}

/* ============ 알림 ============ */
.notification {
    border-radius: 8px;
    font-size: 14px;
    box-shadow: var(--n-shadow-modal);
}

.notification.success {
    background: #0f7b6c;
}

.notification.error {
    background: var(--n-red);
}

.notification.info {
    background: var(--n-blue);
}

/* ============ 관리자 ============ */
.permission-group {
    border: 1px solid var(--n-border);
    border-radius: 8px;
}

.user-item {
    border-bottom: 1px solid var(--n-border);
}

.user-item:last-child {
    border-bottom: none;
}

/* ============ 로그인 ============ */
.login-page {
    background: var(--n-sidebar-bg);
}

.login-container {
    border: 1px solid var(--n-border);
    border-radius: 12px;
    box-shadow: var(--n-shadow-card);
}

.login-form input {
    border: 1px solid var(--n-border);
    border-radius: 6px;
}

.login-form input:focus {
    outline: none;
    border-color: var(--n-blue);
    box-shadow: 0 0 0 2px var(--n-blue-soft);
}

.login-form button {
    background: var(--n-blue);
    border-radius: 6px;
    font-weight: 500;
}

.login-form button:hover {
    background: var(--n-blue-hover);
}

/* ============ 모바일 ============ */
@media (max-width: 768px) {
    .main-content {
        padding: 60px 16px 16px;
    }

    .memo-container {
        height: auto;
        min-height: 0;
    }

    .memo-content {
        padding: 24px 20px;
        min-height: 400px;
    }

    .memo-title-input {
        font-size: 24px;
    }

    .memo-editor {
        min-height: 60vh;
    }
}
