/* ============================================
   창업몰 AI 관리자 스타일시트
   파일명: AI_admin/admin.css
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 16px;
    color: #333;
    background-color: #f4f6f9;
}

a { color: #333; text-decoration: none; }
a:hover { color: #1F839C; }

/* --- 로그인 페이지 --- */
.login-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f4c5c 0%, #1F839C 50%, #2ba5c0 100%);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 400px;
    max-width: 90%;
}
.login-box h1 { text-align: center; font-size: 22px; color: #1F839C; margin-bottom: 8px; }
.login-box .sub-title { text-align: center; font-size: 15px; color: #888; margin-bottom: 30px; }
.login-box .form-group { margin-bottom: 18px; }
.login-box .form-group label { display: block; font-size: 15px; font-weight: bold; color: #555; margin-bottom: 6px; }
.login-box .form-group input {
    width: 100%; padding: 12px 14px; border: 1px solid #ddd; border-radius: 6px; font-size: 16px; transition: border-color 0.2s;
}
.login-box .form-group input:focus { outline: none; border-color: #1F839C; box-shadow: 0 0 0 3px rgba(31,131,156,0.1); }
.login-box .btn-login {
    width: 100%; padding: 13px; background: #1F839C; color: #fff; border: none; border-radius: 6px;
    font-size: 15px; font-weight: bold; cursor: pointer; transition: background 0.2s; margin-top: 10px;
}
.login-box .btn-login:hover { background: #176a7f; }

/* --- 관리자 레이아웃 --- */
.admin-wrap { display: flex; min-height: 100vh; }

/* --- 사이드바 --- */
.sidebar {
    width: 240px; background: #0f4c5c; color: #fff;
    position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100;
}
.sidebar .logo {
    padding: 25px 20px; font-size: 17px; font-weight: bold;
    border-bottom: 1px solid rgba(255,255,255,0.1); text-align: center;
}
.sidebar .logo small { display: block; font-size: 13px; font-weight: normal; color: rgba(255,255,255,0.5); margin-top: 4px; }
.sidebar nav ul { list-style: none; padding: 15px 0; }
.sidebar nav ul li a {
    display: block; padding: 12px 25px; color: rgba(255,255,255,0.7); font-size: 16px;
    transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar nav ul li a:hover,
.sidebar nav ul li a.active { background: rgba(255,255,255,0.1); color: #fff; border-left-color: #5ec4d4; }
.sidebar nav ul li a .menu-icon { margin-right: 10px; width: 20px; display: inline-block; text-align: center; }
.sidebar .menu-divider { border-top: 1px solid rgba(255,255,255,0.1); margin: 10px 20px; }

/* --- 메인 콘텐츠 --- */
.main-content { margin-left: 240px; flex: 1; min-height: 100vh; }

/* --- 상단 헤더바 --- */
.top-bar {
    background: #fff; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); position: sticky; top: 0; z-index: 50;
}
.top-bar .page-title { font-size: 20px; font-weight: bold; color: #333; }
.top-bar .admin-info { font-size: 15px; color: #666; }
.top-bar .admin-info a { color: #e53935; margin-left: 15px; }

/* --- 콘텐츠 영역 --- */
.content-area { padding: 25px 30px; }

/* --- 대시보드 카드 --- */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.dash-card {
    background: #fff; border-radius: 8px; padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); transition: transform 0.2s;
}
.dash-card:hover { transform: translateY(-2px); }
.dash-card .card-icon { font-size: 28px; margin-bottom: 12px; }
.dash-card .card-title { font-size: 15px; color: #888; margin-bottom: 8px; }
.dash-card .card-value { font-size: 28px; font-weight: bold; color: #1F839C; }

/* --- 공통 테이블 --- */
.tbl-wrap { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; }
.tbl-wrap .tbl-header {
    padding: 18px 20px; border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
}
.tbl-wrap .tbl-header h3 { font-size: 18px; color: #333; }

table.admin-tbl { width: 100%; border-collapse: collapse; }
table.admin-tbl thead th {
    background: #f8f9fa; padding: 12px 15px; font-size: 15px; color: #555; text-align: left; border-bottom: 2px solid #dee2e6;
}
table.admin-tbl tbody td { padding: 12px 15px; font-size: 15px; border-bottom: 1px solid #eee; vertical-align: middle; }
table.admin-tbl tbody tr:hover { background: #f8fffe; }

/* --- 공통 버튼 --- */
.btn { display: inline-block; padding: 8px 18px; border: none; border-radius: 5px; font-size: 15px; cursor: pointer; transition: all 0.2s; text-align: center; }
.btn-primary { background: #1F839C; color: #fff; }
.btn-primary:hover { background: #176a7f; color: #fff; }
.btn-danger { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; color: #fff; }
.btn-success { background: #43a047; color: #fff; }
.btn-success:hover { background: #2e7d32; color: #fff; }
.btn-warning { background: #f9a825; color: #fff; }
.btn-warning:hover { background: #f57f17; color: #fff; }
.btn-outline { background: #fff; color: #1F839C; border: 1px solid #1F839C; }
.btn-outline:hover { background: #E8F4F8; }
.btn-sm { padding: 5px 12px; font-size: 14px; }

/* --- 공통 폼 --- */
.form-wrap { background: #fff; border-radius: 8px; padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.form-row { display: flex; align-items: center; margin-bottom: 15px; }
.form-row label { width: 120px; font-size: 15px; font-weight: bold; color: #555; flex-shrink: 0; }
.form-row input, .form-row select, .form-row textarea {
    flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 15px; font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: #1F839C; }
.form-actions { text-align: center; margin-top: 25px; padding-top: 20px; border-top: 1px solid #eee; }

/* --- 페이징 --- */
.paging { text-align: center; padding: 20px; }
.paging a, .paging span { display: inline-block; padding: 6px 12px; margin: 0 2px; border: 1px solid #ddd; border-radius: 4px; font-size: 15px; }
.paging span.current { background: #1F839C; color: #fff; border-color: #1F839C; }
.paging a:hover { background: #E8F4F8; }

/* --- 검색 영역 --- */
.search-area {
    padding: 15px 20px; border-bottom: 1px solid #eee;
    display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
.search-area select, .search-area input {
    padding: 8px 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 15px;
}
.search-area input[type="text"] { width: 250px; }

/* --- 뱃지 --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: bold; }
.badge-active { background: #E8F4F8; color: #1F839C; }
.badge-inactive { background: #f5f5f5; color: #999; }

/* --- AI 조건 카드 --- */
.condition-card {
    background: #fff; border: 1px solid #eee; border-radius: 8px;
    padding: 20px; margin-bottom: 16px; transition: all 0.2s;
}
.condition-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.condition-card.inactive { opacity: 0.5; background: #fafafa; }
.condition-card-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.condition-card-header .card-rank {
    font-size: 15px; font-weight: bold; color: #1F839C;
}
.condition-card-header .card-category {
    font-size: 14px; padding: 3px 10px; border-radius: 12px; background: #E8F4F8; color: #1F839C;
}
.condition-card-title { font-size: 15px; font-weight: bold; margin-bottom: 8px; }
.condition-card-content {
    font-size: 15px; color: #666; line-height: 1.6; background: #f8f9fa;
    padding: 12px; border-radius: 6px; white-space: pre-line;
}
.condition-card-actions { margin-top: 12px; display: flex; gap: 8px; justify-content: flex-end; }

/* --- 충돌 체크 결과 --- */
.conflict-result {
    margin-top: 16px; padding: 16px 20px; border-radius: 8px; font-size: 16px; line-height: 1.7;
}
.conflict-result.success { background: #DCFCE7; border: 1px solid #BBF7D0; color: #166534; }
.conflict-result.warning { background: #FEF9C3; border: 1px solid #FDE68A; color: #854D0E; }
.conflict-result.error { background: #FEE2E2; border: 1px solid #FECACA; color: #991B1B; }
.conflict-result.loading { background: #E8F4F8; border: 1px solid #B2E0EC; color: #1F839C; }

/* --- 채팅 로그 대화 스타일 --- */
.chat-log-item { padding: 15px 20px; border-bottom: 1px solid #f0f0f0; }
.chat-log-item:hover { background: #fafffe; }
.chat-log-q { font-size: 16px; font-weight: bold; color: #333; margin-bottom: 6px; }
.chat-log-q::before { content: 'Q. '; color: #1F839C; }
.chat-log-a { font-size: 15px; color: #666; line-height: 1.5; max-height: 60px; overflow: hidden; }
.chat-log-a::before { content: 'A. '; color: #e53935; font-weight: bold; }
.chat-log-meta { font-size: 13px; color: #aaa; margin-top: 6px; }

/* --- 알림 메시지 --- */
.alert { padding: 12px 16px; border-radius: 6px; font-size: 16px; margin-bottom: 16px; }
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #E8F4F8; color: #1F839C; border: 1px solid #B2E0EC; }

/* --- 반응형 --- */
@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; }
    .content-area { padding: 15px; }
    .dashboard-cards { grid-template-columns: repeat(2, 1fr); }
}
