/* =========================================
   1. 기본 설정 (Variables & Reset)
   ========================================= */
:root {
    --bg-dark: #121418;       /* 전체 배경 */
    --bg-sidebar: #1a1c23;    /* 사이드바 배경 */
    --bg-card: #242630;       /* 카드/박스 배경 */
    
    --text-main: #e2e8f0;     /* 기본 텍스트 */
    --text-muted: #94a3b8;    /* 흐린 텍스트 */
    
    --accent-color: #4f46e5;  /* 포인트 컬러 (Indigo) */
    --accent-hover: #4338ca;
    
    --border-color: #333644;
    
    --sidebar-width: 260px;
    --header-height: 70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    
    /* [핵심 수정] 로그인 페이지 스타일(중앙 정렬) 간섭 방지 */
    display: block !important; 
    width: 100%;
    height: auto;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* =========================================
   2. 레이아웃 구조 (Wrapper & Main)
   ========================================= */
.admin-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative; /* 자식 요소 기준점 */
}

/* 메인 컨텐츠 영역 */
.main-content {
    /* 사이드바 너비만큼 왼쪽 여백을 주어 겹치지 않게 함 */
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease, width 0.3s ease;
    background-color: var(--bg-dark); /* 배경색 명시 */
}

.content-container { padding: 30px; }
.page-title { font-size: 24px; margin-bottom: 25px; font-weight: 700; }

/* 공통 박스 스타일 */
.content-box {
    background-color: var(--bg-card);
    padding: 25px; border-radius: 15px;
    border: 1px solid var(--border-color);
}
.content-box h3 { margin-bottom: 20px; font-size: 18px; }

/* =========================================
   3. 사이드바 (Sidebar)
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed; /* 화면 왼쪽에 고정 */
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 35px; height: 35px; border-radius: 50%; }

.close-sidebar-btn {
    background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; display: none; 
}

.menu-list { padding: 20px 15px; flex: 1; overflow-y: auto; }

.menu-header {
    font-size: 11px; color: var(--text-muted); font-weight: 700; margin-bottom: 10px; margin-top: 15px; letter-spacing: 1px;
}
.menu-header:first-child { margin-top: 0; }

.menu-item { margin-bottom: 5px; }
.menu-item a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 15px;
}

.menu-item a:hover { background-color: rgba(255,255,255,0.05); color: #fff; }
.menu-item.active a {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}
.menu-item i { font-size: 18px; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}
.logout-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 12px;
    background-color: #2d303e; border-radius: 8px; color: #ff6b6b; font-size: 14px;
    transition: 0.2s;
}
.logout-btn:hover { background-color: #383b4b; }

/* =========================================
   4. 상단 헤더 (Top Header)
   ========================================= */
.top-header {
    height: var(--header-height);
    background-color: var(--bg-sidebar); 
    border-bottom: 1px solid var(--border-color);
    
    display: flex; 
    align-items: center;
    justify-content: space-between; 
    
    padding: 0 30px;
    position: sticky; /* 스크롤 시 상단 고정 */
    top: 0; 
    z-index: 900;
    width: 100%;
}
.menu-toggle-btn {
    background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; display: none;
}
.header-right { margin-left: auto; } 
.user-info { text-align: right; }
.user-role { display: block; font-size: 17px; line-height: normal; color: var(--accent-color); font-weight: 700; }
.user-name { font-size: 14px; font-weight: 500; }

/* =========================================
   5. 공통 UI 요소 (버튼, 테이블, 모달 등)
   ========================================= */

/* [버튼 스타일] */
.btn-action {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; font-size: 13px; font-weight: 600;
    border: none; border-radius: 6px; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 0.5px; text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #ffffff; }
.btn-primary:hover { background: linear-gradient(135deg, #764ba2 0%, #667eea 100%); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0,0,0,0.2); opacity: 0.9; }
.btn-action:disabled, .btn-action.disabled { background: #4a4d5a; color: #999; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-danger { background: linear-gradient(135deg, #ff6b6b 0%, #e03e3e 100%); color: #ffffff; }
.btn-danger:hover { background: linear-gradient(135deg, #e03e3e 0%, #ff6b6b 100%); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(224, 62, 62, 0.4); }
.btn-danger:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.btn-success { background: linear-gradient(135deg, #2ecc71 0%, #219150 100%); color: #ffffff; }
.btn-success:hover { background: linear-gradient(135deg, #219150 0%, #2ecc71 100%); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(46, 204, 113, 0.4); }
.btn-success:active { transform: translateY(0); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

/* [기본 테이블 스타일] */
.table-responsive { overflow-x: auto; width: 100%; }
.basic-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.basic-table th {
    text-align: left; padding: 15px; border-bottom: 2px solid var(--border-color);
    color: var(--text-muted); font-size: 13px; font-weight: 600;
}
.basic-table td {
    padding: 10px; border-bottom: 1px solid var(--border-color);
    font-size: 12px; font-weight: 300;
}
.basic-table tr:last-child td { border-bottom: none; }
.basic-table td.tdtitle { font-size: 12px; font-weight: 400; }
.badge { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.badge.success { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge.warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }

/* [모달 스타일] */
.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
    z-index: 9999; display: none; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.custom-modal-overlay.show { display: flex; opacity: 1; }

.custom-modal-box {
    background: #25262b; width: 90%; max-width: 400px; padding: 30px 25px;
    border-radius: 20px; border: 1px solid #333; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center; display: flex; flex-direction: column; align-items: center;
}
.modal-title {
    color: #fff; font-size: 1.5rem; font-weight: 700; width: 100%;
    padding-bottom: 15px; margin-bottom: 20px; border-bottom: 1px solid #45464e;
    word-break: keep-all;
}
.modal-message {
    color: #d1d1d6; font-size: 1rem; margin-bottom: 25px; line-height: 1.6; width: 100%;
    word-break: keep-all; word-wrap: break-word; overflow-wrap: break-word;
}
.modal-btn-group { display: flex; gap: 12px; width: 100%; justify-content: center; }
.modal-btn {
    padding: 12px 0; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer;
    border: none; flex: 1; max-width: 150px;
}
.btn-cancel { background: #3f3f46; color: #fff; }
.btn-cancel:hover { background: #52525b; }
.btn-confirm { background: #fbbf24; color: #000; }
.btn-confirm:hover { background: #f59e0b; }
.modal-icon-area { font-size: 3rem; margin-bottom: 15px; }
.bigradio { width: 20px; height: 20px; position: relative; top: 4px; }

/* =========================================
   6. 반응형 처리 (Mobile)
   ========================================= */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); width: 260px; }
    .sidebar.active { transform: translateX(0); }
    
    .close-sidebar-btn { display: block; }
    .menu-toggle-btn { display: block; }
    
    .main-content { margin-left: 0; width: 100%; }
    
    .overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); z-index: 950; display: none;
    }
    .overlay.active { display: block; }
}