/* 
 * ==========================================
 * 공통 디자인 요소 (전역 변수 및 기본 스타일)
 * ==========================================
 */
:root {
    --orange: #ff8021;
    /* 기본 테마 컬러 (주황) */
    --dark: #e65100;
    /* 짙은 테마 컬러 (호버 등 강조 효과) */
    --light: #fff3e0;
    /* 밝은 배경 컬러 */
    --bg: #f8f9fa;
    /* 깨끗하고 눈이 편한 기본 배경색 */
    --card-border: #e9ecef;
    /* 카드 요소의 테두리 색상 */
    --pending: #f44336;
    /* 미완료 상태: 빨강 */
    --done: #4caf50;
    /* 완료 상태: 초록 */
}

body {
    font-family: 'Malgun Gothic', sans-serif;
    margin: 0;
    background-color: var(--bg);
    font-size: 14px;
    color: #333;
}

/* 
 * ==========================================
 * 레이아웃 및 내비게이션 (로그인 화면, 탭)
 * ==========================================
 */

/* 로그인 화면 오버레이 설정 (전체 화면 덮기) */
#login-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 상단 탭 내비게이션 바 */
.nav-bar {
    background: white;
    display: none;
    /* 로그인 전에는 숨김 */
    justify-content: space-around;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    /* 스크롤 시 상단 고정 */
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #eee;
}

/* 개별 탭 버튼 */
.nav-item {
    cursor: pointer;
    padding: 15px 5px;
    font-weight: bold;
    color: #888;
    flex: 1;
    text-align: center;
    font-size: 12px;
    display: none;
    /* 권한에 따라 표시됨 */
    transition: 0.2s;
    /* 부드러운 색상 전환 효과 */
}

/* 활성화된 탭 스타일 */
.nav-item.active {
    color: var(--orange);
    border-bottom: 3px solid var(--orange);
}

/* 콘텐츠 섹션 (각 탭의 화면) */
.content-section {
    display: none;
    /* 기본 숨김 */
    padding: 15px;
    max-width: 1100px;
    margin: 0 auto;
    /* 중앙 정렬 */
}

/* 활성화된 콘텐츠 화면 보이기 */
.content-section.active {
    display: block;
}

/* 
 * ==========================================
 * 카드 디자인 (목록 아이템, 공통 컨테이너)
 * ==========================================
 */
.card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 12px;
    transition: transform 0.2s;
    border: 1px solid var(--card-border);
}

/* 카드에 마우스를 올렸을 때의 떠오르는 효과 */
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

/* 
 * ==========================================
 * ToDo 탭 - 달력 (Calendar) 스타일
 * ==========================================
 */
.calendar-wrapper {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--card-border);
}

/* 달력 상단 (월 이동 버튼 및 제목) */
.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
    color: #444;
}

/* 요일/날짜 그리드 설정 (7열) */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

/* 요일 헤더 (일~토) */
.cal-day-label {
    font-size: 11px;
    color: #aaa;
    padding-bottom: 8px;
    font-weight: bold;
}

/* 개별 날짜 셀 */
.cal-date {
    padding: 10px 0;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    position: relative;
    transition: background 0.2s;
    min-height: 45px;
}

/* 날짜 호버 및 오늘/선택된 날짜 스타일 */
.cal-date:hover {
    background: #f1f3f5;
}

.cal-date.today {
    background: #e7f5ff;
    color: #228be6;
    font-weight: bold;
}

.cal-date.selected {
    background: var(--orange);
    color: white;
    font-weight: bold;
}

/* 일정 유무를 표시하는 점(Dot) 컨테이너 */
.cal-dot-container {
    display: flex;
    justify-content: center;
    gap: 2px;
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    pointer-events: none;
    flex-wrap: wrap;
    padding: 0 4px;
}

/* 일정 유무를 표시하는 점 스타일 (미완료/완료) */
.cal-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.cal-dot.pending {
    background: var(--pending);
}

.cal-dot.done {
    background: var(--done);
}

/* 기간(여러 날) 일정 라인 표시 컨테이너 */
.cal-event-lines {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    height: 0;
    pointer-events: none;
}

/* 실제 기간 일정 라인 스타일 (둥근 모서리 등 처리) */
.cal-event-line {
    height: 4px;
    opacity: 0.7;
    position: absolute;
    left: 0;
    right: 0;
    border: none;
}

.cal-event-line.pending {
    background: var(--pending);
}

.cal-event-line.done {
    background: var(--done);
}

.cal-event-line.start {
    margin-left: 4px;
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
}

.cal-event-line.end {
    margin-right: 4px;
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
}

.cal-event-line.full {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
}

/* 
 * ==========================================
 * ToDo 탭 - 리스트 레이아웃
 * ==========================================
 */
/* 미완료 / 완료 2단 그리드 */
.todo-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 10px;
    align-items: start;
}

/* 모바일 화면에서는 1단 구성으로 변경 */
@media (max-width: 768px) {
    .todo-container {
        grid-template-columns: 1fr;
    }
}

/* ToDo 각 단의 제목 */
.todo-column-title {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 5px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
    color: #495057;
}

/* 스크롤 영역 설정 */
.todo-list-scroll {
    max-height: 550px;
    overflow-y: auto;
    padding-right: 5px;
}

.todo-list-scroll::-webkit-scrollbar {
    width: 6px;
}

.todo-list-scroll::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 10px;
}

/* 각 아이템의 좌측 포인트 테두리 스타일 */
.todo-card {
    border-left: 5px solid #ffa94d;
    cursor: pointer;
    background: white;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
}

.todo-card.completed {
    border-left: 5px solid #adb5bd;
    background: #f8f9fa;
    opacity: 0.8;
}

.site-card {
    border-left: 5px solid #4dabf7;
    cursor: pointer;
}

.pw-card {
    border-left: 5px solid #fab005;
    cursor: pointer;
}

.inter-card {
    border-left: 5px solid #be4bdb;
    cursor: pointer;
}

.trouble-card {
    border-left: 5px solid #ff6b6b;
    cursor: pointer;
}

/* 
 * ==========================================
 * 입력 폼 및 버튼 (Input, Select, Button)
 * ==========================================
 */
input,
textarea,
button,
select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #ddd;
    outline: none;
    background: #fff;
    font-size: 13px;
}

input:focus,
textarea:focus {
    border-color: var(--orange);
}

/* 주요 동작 버튼 (저장, 등록 등) */
.btn-main {
    background: var(--orange);
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
    padding: 12px;
    transition: 0.2s;
}

.btn-main:hover {
    background: var(--dark);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.btn-main:disabled {
    background: #ced4da;
    cursor: not-allowed;
}

/* 삭제 버튼 전용 스타일 */
.btn-delete {
    background: #fa5252;
    color: white;
    margin-top: 8px;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    display: none;
    /* 기본 숨김. 편집 시에만 나타남 */
}

.btn-delete:hover {
    background: #e03131;
}

/* 링크 형태 버튼 (예: 첨부파일 열람 버튼 등) */
.btn-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #495057;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    font-size: 11px;
    vertical-align: middle;
    margin-left: 5px;
    transition: 0.2s;
}

/* 
 * ==========================================
 * 모달 창 (Modal)
 * ==========================================
 */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    margin: 20px auto;
    padding: 20px;
    width: 95%;
    max-width: 800px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: none;
}

/* 
 * ==========================================
 * 상세 폼 내부 그리드 레이아웃
 * ==========================================
 */
.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 두 칸을 모두 차지해야 하는 필드 (주소, 비고 등) */
.grid-full {
    grid-column: span 2;
}

/* 각 입력 필드 위의 라벨 텍스트 */
.label-tag {
    font-size: 11px;
    color: #666;
    margin-top: 10px;
    margin-bottom: -4px;
    display: block;
    font-weight: bold;
    padding-left: 2px;
}

/* 조회된 갯수 등을 표시하는 배지 텍스트 */
.count-badge {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: bold;
}

/* 
 * ==========================================
 * 뱃지 및 카드 내부 디자인
 * ==========================================
 */
.status-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 5px;
}

.badge-ing {
    background: #fff4e6;
    color: #fd7e14;
    border: 1px solid #ffe8cc;
}

.badge-done {
    background: #ebfbee;
    color: #40c057;
    border: 1px solid #d3f9d8;
}

.todo-time {
    font-size: 12px;
    color: #868e96;
    font-weight: bold;
}

.todo-site-tag {
    color: var(--dark);
    font-weight: bold;
    margin-right: 5px;
}

/* 검색 결과 카테고리 헤더 */
.search-result-category {
    font-size: 13px;
    font-weight: bold;
    padding: 8px 15px;
    background: #f1f3f5;
    border-radius: 8px;
    margin-top: 25px;
    margin-bottom: 12px;
    display: block;
    color: #495057;
}

/* 
 * ==========================================
 * 모달 창 내부 그룹 박스 (섹션 구분)
 * ==========================================
 */
.field-group {
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 15px;
    border: 1px solid #eee;
    background-color: #fff;
}

/* 그룹 제목 배지 */
.group-title {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 12px;
    padding: 3px 12px;
    border-radius: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 각 그룹별 테마 색상 정의 */
.group-1 {
    background-color: #f1f7ff;
    border-color: #d0e4ff;
}

.group-1 .group-title {
    background-color: #339af0;
    color: white;
}

.group-2 {
    background-color: #f3fcf4;
    border-color: #dcfce7;
}

.group-2 .group-title {
    background-color: #51cf66;
    color: white;
}

.group-3 {
    background-color: #f8f0ff;
    border-color: #f3d9fa;
}

.group-3 .group-title {
    background-color: #ae3ec9;
    color: white;
}

.group-4 {
    background-color: #fff9db;
    border-color: #fff3bf;
}

.group-4 .group-title {
    background-color: #fcc419;
    color: #444;
}

.group-5 {
    background-color: #fff4e6;
    border-color: #ffe8cc;
}

.group-5 .group-title {
    background-color: #ff922b;
    color: white;
}

.group-8 {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.group-8 .group-title {
    background-color: #868e96;
    color: white;
}

/* 
 * ==========================================
 * 기타 유틸리티
 * ==========================================
 */

/* 읽기 전용 필드 (회색 배경) */
.readonly-field {
    background-color: #f1f3f5;
    color: #868e96;
    cursor: not-allowed;
    border: 1px solid #dee2e6;
}

/* 편집자 권한에게만 보여야 하는 요소 */
.editor-only {
    display: none;
}

/* 
 * ==========================================
 * 인라인 스타일 분리 (추가된 유틸리티/컴포넌트 클래스)
 * ==========================================
 */
.login-title-container {
    text-align: center;
    margin-bottom: 30px;
}

.login-title {
    color: var(--orange);
    font-size: 28px;
    margin: 0;
}

.login-box {
    width: 300px;
    background: white;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f3f5;
}

.login-input-id {
    margin-bottom: 10px;
    border-radius: 12px;
    padding: 14px;
}

.login-input-pw {
    border-radius: 12px;
    padding: 14px;
}

.login-btn-style {
    margin-top: 20px;
    border-radius: 12px;
    padding: 14px;
    font-size: 15px;
}

.login-ip-text {
    margin-top: 40px;
    font-size: 12px;
    color: #ced4da;
    letter-spacing: 0.5px;
}

.search-card-style {
    border-radius: 40px;
    padding: 5px 25px;
    background: #fff;
    border: 1px solid #ffd8a8;
    margin-top: 10px;
}

.search-input-style {
    border: none;
    background: transparent;
    font-size: 15px;
    padding: 15px 0;
}

.search-count-badge {
    margin-top: 15px;
    padding-left: 5px;
}

.cal-nav-btn {
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

.cal-month-title-style {
    font-size: 18px;
    color: #212529;
}

.text-red {
    color: #fa5252;
}

.text-blue {
    color: #228be6;
}

.rounded-search-input {
    border-radius: 30px;
    padding: 12px 20px;
}

.flex-gap-mt10 {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-filter-clear {
    flex: 1;
    background: #868e96;
    border-radius: 10px;
}

.btn-todo-new-style {
    flex: 2;
    border-radius: 10px;
    background: var(--orange);
}

.pending-dot {
    color: var(--pending);
    margin-right: 5px;
}

.done-dot {
    color: var(--done);
    margin-right: 5px;
}

.btn-site-new-style {
    margin-top: 12px;
    background: #73A9F7;
}

.pl-5 {
    padding-left: 5px;
}

.rounded-input-20 {
    border-radius: 20px;
}

.btn-trouble-new-style {
    margin-top: 12px;
    background: #f57c00;
}

.btn-inter-new-style {
    margin-top: 12px;
    background: #ae3ec9;
}

.btn-pw-new-style {
    margin-top: 12px;
    background: #fab005;
}

.modal-body-scroll {
    max-height: 70vh;
    overflow-y: auto;
    padding: 5px;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.btn-save-style {
    margin-top: 20px;
    border-radius: 12px;
    background: #40c057;
}

.btn-del-style {
    border-radius: 12px;
}

.btn-close-style {
    border: none;
    background: none;
    margin-top: 15px;
    cursor: pointer;
    width: 100%;
    color: #adb5bd;
    font-size: 13px;
}

.mb-20 {
    margin-bottom: 20px;
}

.border-top-section {
    border-top: 1px solid #eee;
    margin-top: 10px;
    padding-top: 10px;
}

.btn-close-style-2 {
    border: none;
    background: none;
    margin-top: 15px;
    cursor: pointer;
    width: 100%;
    color: #adb5bd;
}

.z-3000 {
    z-index: 3000;
}

.file-viewer-content-style {
    max-width: 900px;
    padding: 0;
    overflow: hidden;
}

.file-viewer-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-viewer-title-style {
    margin: 0;
    color: #495057;
    font-size: 16px;
    word-break: break-all;
    padding-right: 15px;
}

.file-viewer-close-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 24px;
    color: #adb5bd;
    font-weight: bold;
    line-height: 1;
}

.file-viewer-body {
    text-align: center;
    background: #fff;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.trouble-existing-img-container {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid #dee2e6;
}

.trouble-existing-img-link {
    cursor: pointer;
    color: #1c7ed6;
    text-decoration: underline;
}

.trouble-img-del-btn {
    margin-left: 8px;
    cursor: pointer;
    color: #fa5252;
    font-weight: bold;
    padding: 0 4px;
}

.trouble-new-img-span {
    display: inline-block;
    padding: 5px 10px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid #ced4da;
    color: #495057;
}

/* Dynamic JS Styles */
.ds-1 {
    color: #212529;
}

.ds-2 {
    color: #868e96;
    font-weight: bold;
}

.ds-3 {
    color: #868e96;
    margin-bottom: 20px;
    font-size: 15px;
}

.ds-4 {
    color: #adb5bd;
    font-size: 11px;
    font-weight: bold;
}

.ds-5 {
    color: #e65100;
}

.ds-6 {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.ds-7 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ds-8 {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #f1f3f5;
    border-radius: 6px;
    font-size: 11px;
    color: inherit;
    cursor: pointer;
    border: 1px solid #ced4da;
    text-decoration: none;
    margin-right: 5px;
}

.ds-9 {
    flex: 1.2;
    font-weight: bold;
    font-size: 14px;
    white-space: pre-wrap;
    color: #ae3ec9;
}

.ds-10 {
    flex: 1;
    text-align: center;
    white-space: pre-wrap;
    color: #495057;
}

.ds-11 {
    flex: 1;
    text-align: right;
    white-space: pre-wrap;
    color: #495057;
}

.ds-12 {
    font-size: 11px;
    color: #868e96;
    font-weight: bold;
    margin-bottom: 6px;
    white-space: pre-wrap;
}

.ds-13 {
    font-size: 11px;
    color: #868e96;
    margin-top: 8px;
    white-space: pre-wrap;
    border-top: 1px solid #f1f3f5;
    padding-top: 5px;
}

.ds-14 {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 8px;
    border-top: 1px dashed #eee;
    padding-top: 4px;
}

.ds-15 {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 8px;
    border-top: 1px dashed #f1f3f5;
    padding-top: 6px;
}

.ds-16 {
    font-size: 12px;
    color: #495057;
    margin-top: 5px;
}

.ds-17 {
    font-size: 12px;
    color: #666;
}

.ds-18 {
    font-size: 12px;
    color: #868e96;
    margin-top: 6px;
}

.ds-19 {
    font-size: 12px;
    font-weight: normal;
}

.ds-20 {
    font-size: 13px;
    margin-top: 8px;
    background: #fff9db;
    padding: 10px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #fff3bf;
}

.ds-21 {
    font-size: 30px;
    margin-bottom: 10px;
    text-align: center;
}

.ds-22 {
    font-weight: bold;
    color: #1c7ed6;
    font-size: 15px;
}

.ds-23 {
    font-weight: bold;
    color: #495057;
    font-size: 15px;
}

.ds-24 {
    font-weight: bold;
    color: #ff6b6b;
    border-bottom: 1px solid #f1f3f5;
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.ds-25 {
    font-weight: bold;
    margin-top: 6px;
    font-size: 14px;
}

.ds-26 {
    margin-top: 10px;
}

.ds-27 {
    margin-top: 5px;
}

.ds-28 {
    margin-top: 5px;
    font-size: 13px;
    white-space: pre-wrap;
    color: #495057;
    line-height: 1.4;
}

.ds-29 {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    margin: 0 auto;
}

.ds-30 {
    padding: 20px;
    color: #fa5252;
    font-weight: bold;
}

.ds-31 {
    padding: 50px 20px;
}

.ds-32 {
    text-decoration: none;
    display: inline-block;
    border-radius: 8px;
    padding: 10px 20px;
}

.ds-33 {
    white-space: pre-wrap;
}

.ds-34 {
    white-space: pre-wrap;
    margin-top: 2px;
    line-height: 1.5;
    color: #2f9e44;
}

.ds-35 {
    white-space: pre-wrap;
    margin-top: 2px;
    line-height: 1.5;
    color: #343a40;
}

.ds-36 {
    white-space: pre-wrap;
    text-align: right;
}

.ds-37 {
    width: 100%;
    height: 75vh;
    overflow: auto;
    background: #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
}

.btn-site-sync-style {
    background: #20c997;
    border-radius: 10px;
    flex: 1;
}

.btn-site-new-style2 {
    background: #73A9F7;
    border-radius: 10px;
    flex: 1;
}

/* Custom Added Classes to replace inline styles */
.empty-list-msg {
    text-align: center;
    color: #ced4da;
    padding: 20px;
}

.empty-search-msg {
    text-align: center;
    padding: 50px;
    color: #ced4da;
}

.secure-file-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--dark);
    font-size: 16px;
    border-radius: 12px;
}

.pdf-canvas {
    margin-bottom: 15px;
    max-width: 95%;
    height: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    background: #fff;
}