/* --- 1. 기본 및 폰트 설정 (ktcs Screen 스타일과 동기화) --- */
@font-face {
    font-family: 'Dalmoori';
    src: url('fonts/dalmoori.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: #f4f4f8;
    color: #333333;
    font-family: 'Pretendard', sans-serif;
    overflow-y: auto;
}

/* --- 2. 상단 고정 UI (ktcs Screen 스타일과 동기화) --- */
.credit-text {
    font-family: 'Dalmoori', sans-serif;
    position: fixed;
    top: 20px;
    left: 25px;
    font-size: 20px;
    color: rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.company-logo {
    position: fixed;
    top: 20px;
    right: 25px;
    width: 70px;
    height: auto;
    opacity: 0.5;
    z-index: 1000;
}

/* --- 3. 전체 레이아웃 및 페이지 전환 --- */
.content-wrapper {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.page {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.login.page, .menu.page {
    display: flex; /* JS로 이 클래스가 활성화될 때 보이도록 */
    justify-content: center;
    gap: 40px; /* 로고와 폼/메뉴 사이의 간격 */
}

/* --- 4. 로그인 및 메뉴 페이지 (ktcs Screen 스타일 적용) --- */
.main-logo {
    display: block;
    width: 450px; /* 로고 크기 조정 */
    margin-bottom: 10px; /* 로고와 아래 컨텐츠 간격 */
    animation: fadeInLogo 0.8s ease-out forwards;
}

@keyframes fadeInLogo {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    width: 350px;
    box-sizing: border-box;
}

.input-group {
    display: flex;
    align-items: center;
    width: 100%;
}

.input-group span {
    width: 60px;
    font-weight: 600;
}

.input-group input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

/* --- 5. 버튼 스타일 (ktcs Screen 스타일 완벽 동기화) --- */

/* 5-1. 로그인 버튼 및 메뉴 버튼 공통 스타일 */
.form-container button.login,
.menu.page > * {
    background: #ffffff;
    color: #333333;
    font-family: 'Dalmoori', sans-serif;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    border: 1px solid #dddddd;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 12px;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-shadow: none;
    
    width: 350px;
    padding: 20px 15px;
    box-sizing: border-box;
    text-align: center;
    
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none; /* div, p 등 다른 태그도 버튼처럼 보이게 하기 위함 */
}

/* 로그인 버튼만 특별히 너비를 100%로 설정 */
.form-container button.login {
    width: 100%;
    font-size: 20px; /* 로그인 버튼은 약간 작게 */
    padding: 15px;
}


/* 호버 및 클릭 효과 */
.form-container button.login:hover,
.menu.page > *:hover {
    transform: translateY(-3px);
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.15);
}

.form-container button.login:active,
.menu.page > *:active {
    transform: translateY(1px);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

/* 5-2. 관리자 페이지 내부의 작은 버튼 */
.btn-table {
    background: #f8f8f9;
    color: #333;
    font-family: 'Pretendard', sans-serif;
    font-size: 11px;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    min-width: auto;
}
.btn-table:hover {
    background: #e9e9ed;
    border-color: #ccc;
}


/* --- 6. 관리자 페이지 (테이블, 검색) --- */
.admin-user, .admin-app, .admin-log {
    gap: 20px;
    padding-top: 80px; /* 상단 고정 UI와의 간격 확보 */
}

/* (이하 관리자 페이지 스타일은 이전과 동일하게 유지) */
.search, .log { display: flex; gap: 10px; align-items: center; background: #fff; padding: 15px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); width: 100%; box-sizing: border-box; }
.search select, .log select { padding: 8px; border-radius: 8px; border: 1px solid #ddd; font-size: 11px; }
.table-container { width: 100%; background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { background-color: #f8f8f9; font-weight: 600; padding: 10px 8px; border-bottom: 1px solid #eee; text-align: center; }
td { padding: 8px; border-bottom: 1px solid #eee; text-align: center; vertical-align: middle; }
tbody tr:hover { background-color: #f5f5f5; }
td input, td select, td textarea { width: 95%; padding: 5px; border: 1px solid #ccc; border-radius: 5px; font-size: 11px; box-sizing: border-box; text-align: center; }
td[data-value="noti"] textarea { min-height: 160px; resize: vertical; text-align: center; white-space: pre-wrap; }
.admin-app table { table-layout: fixed; }
.admin-app th:nth-child(1), .admin-app td:nth-child(1) { width: 10%; }
.admin-app th:nth-child(2), .admin-app td:nth-child(2) { width: 25%; }
.admin-app th:nth-child(3), .admin-app td:nth-child(3) { width: 40%; }
.admin-app th:nth-child(4), .admin-app td:nth-child(4) { width: 15%; }
.admin-app th:nth-child(5), .admin-app td:nth-child(5) { width: 10%; }

/* --- 7. 기타 컴포넌트 (모달, 토스트, 홈 버튼) --- */
.modal.msg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); z-index: 9999; display: none; justify-content: center; align-items: center; }
.modal-content { background-color: #fff; padding: 20px; border-radius: 5px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); text-align: center; max-width: 400px; width: 90%; position: relative; }
.close { position: absolute; top: 10px; right: 15px; font-size: 24px; font-weight: 700; cursor: pointer; color: #aaa; }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; }
.toast { background-color: #333; color: #fff; padding: 15px; border-radius: 5px; margin-bottom: 10px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); opacity: 0; transition: opacity .5s ease-in-out; }
.toast.show { opacity: 1; }
.home-button { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background-color: #ffffff; border-radius: 50%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); z-index: 1000; display: none; justify-content: center; align-items: center; cursor: pointer; transition: all 0.3s ease; }
.home-button:hover { transform: scale(1.1); }
.home-button svg { color: #333; }

/* --- 8. 반응형 디자인 --- */
@media (max-width: 768px) {
    .credit-text { font-size: 16px; top: 20px; left: 20px; }
    .company-logo { width: 50px; top: 15px; right: 20px; }
    .main-logo { width: 350px; }
    .form-container, .menu.page > * { width: calc(100% - 40px); }
    .admin-user, .admin-app, .admin-log { padding-top: 70px; }
}

@media (max-width: 480px) {
    .credit-text { display: none; }
    .company-logo { width: 40px; top: 10px; right: 15px; }
    .main-logo { width: 280px; }
    .form-container button.login, .menu.page > * { font-size: 20px; }
    .home-button { width: 45px; height: 45px; bottom: 20px; right: 20px; }
}

/* 1. '사용자 관리' 페이지만 가로로 넓게 만들기 */
.admin-user.page {
    max-width: 95%; /* 최대 너비를 화면의 95%로 설정하여 넓게 표시 */
    padding-top: 60px; /* 상단 여백 조정 */
}

/* 2. 'item_key' 컬럼 숨기기 (테이블의 첫 번째 열) */
.admin-user th:first-child,
.admin-user td:first-child {
    display: none;
}

.content-wrapper.admin-user-active {
    justify-content: flex-start;
}