/* =====================================================
   보험AI지식센터 - 메인 스타일시트
   ===================================================== */

:root {
  --primary: #1a3c6e;
  --primary-light: #2554a0;
  --primary-dark: #112a50;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 64px;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===================== 스크롤바 ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===================== 사이드바 ===================== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  height: var(--header-height);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}
.logo-main {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* 사이드바 네비게이션 */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}
.sidebar-nav ul { list-style: none; }

.nav-section-title {
  padding: 14px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  flex: 1;
  transition: var(--transition);
}
.nav-item a i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}
.nav-item a span { overflow: hidden; text-overflow: ellipsis; }

.nav-item:hover { background: rgba(255,255,255,0.08); }
.nav-item:hover a { color: #fff; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(59,130,246,0.35), rgba(59,130,246,0.15));
  border-left: 3px solid var(--accent);
}
.nav-item.active a { color: #fff; font-weight: 600; }

.nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-right: 10px;
  flex-shrink: 0;
  min-width: 20px;
  text-align: center;
}

/* 사이드바 푸터 */
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.system-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}
.system-info .online { color: var(--success); font-size: 8px; }

/* ===================== 메인 컨텐츠 ===================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ===================== 상단 헤더 ===================== */
.top-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-left { display: flex; align-items: center; gap: 12px; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right { display: flex; align-items: center; gap: 12px; }

.quick-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 16px;
  transition: var(--transition);
}
.quick-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.quick-search i { color: var(--text-muted); font-size: 13px; }
.quick-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  width: 220px;
  font-family: inherit;
}

.upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
}
.upload-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }

/* ===================== 페이지 컨테이너 ===================== */
.page-container { flex: 1; padding: 28px; }

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}
.page-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ===================== 통계 카드 ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card.blue .stat-icon { background: rgba(59,130,246,0.12); color: var(--accent); }
.stat-card.green .stat-icon { background: rgba(16,185,129,0.12); color: var(--success); }
.stat-card.purple .stat-icon { background: rgba(139,92,246,0.12); color: var(--purple); }
.stat-card.orange .stat-icon { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-value { font-size: 30px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===================== AI 배너 ===================== */
.ai-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  color: #fff;
  box-shadow: var(--shadow);
}
.ai-banner-content { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.ai-banner-icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.ai-banner-text h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.ai-banner-text p { font-size: 13px; color: rgba(255,255,255,0.8); }
.ai-banner-search {
  display: flex;
  gap: 10px;
}
.ai-banner-search input {
  flex: 1;
  border: none;
  border-radius: 30px;
  padding: 12px 20px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: rgba(255,255,255,0.95);
  color: var(--text);
}
.ai-banner-search button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition);
}
.ai-banner-search button:hover { background: #2563eb; transform: translateY(-1px); }

/* ===================== 섹션 타이틀 ===================== */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: var(--accent); }

/* ===================== 메뉴 카드 ===================== */
.menu-section { margin-bottom: 28px; }
.menu-cards {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}
.menu-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.menu-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0;
  transition: var(--transition);
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.menu-card:hover::before { opacity: 1; }
.menu-card:nth-child(1)::before { background: linear-gradient(90deg, #667eea, #764ba2); }
.menu-card:nth-child(2)::before { background: linear-gradient(90deg, #f093fb, #f5576c); }
.menu-card:nth-child(3)::before { background: linear-gradient(90deg, #4facfe, #00f2fe); }
.menu-card:nth-child(4)::before { background: linear-gradient(90deg, #43e97b, #38f9d7); }
.menu-card:nth-child(5)::before { background: linear-gradient(90deg, #fa709a, #fee140); }
.menu-card:nth-child(6)::before { background: linear-gradient(90deg, #a18cd1, #fbc2eb); }
.menu-card:nth-child(7)::before { background: linear-gradient(90deg, #96fbc4, #f9f586); }

.menu-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: #fff;
  margin: 0 auto 10px;
}
.menu-card-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.menu-card h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.menu-card p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}
.menu-card-count {
  display: inline-block;
  background: var(--bg);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* ===================== 대시보드 하단 ===================== */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dashboard-col {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

/* ===================== 문서 리스트 ===================== */
.doc-list { display: flex; flex-direction: column; gap: 10px; }

.doc-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.doc-list-item:hover { background: var(--bg); border-color: var(--border); }

.doc-list-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.doc-list-icon.pdf { background: rgba(239,68,68,0.12); color: #ef4444; }
.doc-list-icon.pptx, .doc-list-icon.ppt { background: rgba(245,158,11,0.12); color: #f59e0b; }
.doc-list-icon.docx, .doc-list-icon.doc { background: rgba(59,130,246,0.12); color: #3b82f6; }
.doc-list-icon.default { background: rgba(100,116,139,0.12); color: #64748b; }

.doc-list-info { flex: 1; overflow: hidden; }
.doc-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.doc-list-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}
.doc-list-count { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.doc-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}

/* ===================== 문서 그리드 (카드형) ===================== */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.doc-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent-light); }

.doc-card-header {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.doc-card-file-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.doc-card-meta { flex: 1; }
.doc-card-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 6px;
}
.doc-card-type.pdf { background: rgba(239,68,68,0.1); color: #dc2626; }
.doc-card-type.pptx, .doc-card-type.ppt { background: rgba(245,158,11,0.1); color: #d97706; }
.doc-card-type.docx, .doc-card-type.doc { background: rgba(59,130,246,0.1); color: #2563eb; }
.doc-card-type.etc { background: rgba(100,116,139,0.1); color: #475569; }

.doc-card-category {
  font-size: 11px;
  color: var(--text-muted);
}
.doc-card-body { padding: 0 16px 16px; }
.doc-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-card-summary {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.doc-card-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.keyword-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  color: var(--text-muted);
}
.doc-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===================== 카테고리 필터 ===================== */
.category-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--bg-card);
  transition: var(--transition);
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.filter-select {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 30px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.filter-select:focus { border-color: var(--accent); }

/* ===================== 검색 페이지 ===================== */
.search-hero {
  background: linear-gradient(135deg, var(--primary), #1e40af);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
}
.search-hero-inner { max-width: 700px; margin: 0 auto; }
.search-big-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 50px;
  padding: 6px 6px 6px 20px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}
.search-icon-big { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.search-big-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 8px 14px;
  font-family: inherit;
  color: var(--text);
}
.search-big-wrap button {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff;
  border: none;
  border-radius: 40px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: var(--transition);
}
.search-big-wrap button:hover { opacity: 0.9; }

.search-keywords {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.keyword-label { font-size: 12px; color: rgba(255,255,255,0.7); }
.keyword-tag {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.keyword-tag:hover { background: rgba(255,255,255,0.25); }

.search-result-header { margin-bottom: 16px; }
.search-result-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }

.ai-summary-box {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.ai-summary-box .ai-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ai-summary-box .ai-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
}
.result-sub-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-sub-title i { color: var(--accent); }

/* ===================== AI 상담 채팅 ===================== */
.consult-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  height: calc(100vh - 200px);
}

.chat-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}
.chat-message.user { flex-direction: row-reverse; }

.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.chat-message.ai .chat-avatar {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}
.chat-message.user .chat-avatar {
  background: linear-gradient(135deg, var(--success), #34d399);
  color: #fff;
}

.chat-bubble {
  max-width: 75%;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.7;
}
.chat-message.ai .chat-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px 16px 16px 16px;
  color: var(--text);
}
.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 16px 4px 16px 16px;
}

.chat-bubble p { margin-bottom: 6px; }
.chat-bubble p:last-child { margin-bottom: 0; }

.chat-examples {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.chat-examples button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--accent);
  text-align: left;
  transition: var(--transition);
}
.chat-examples button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}
.chat-input-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.chat-input-wrap textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: var(--transition);
  color: var(--text);
  background: var(--bg);
}
.chat-input-wrap textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.chat-input-wrap button {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  align-self: flex-end;
  transition: var(--transition);
}
.chat-input-wrap button:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.chat-mode-btns {
  display: flex;
  gap: 8px;
}
.mode-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  background: none;
  color: var(--text-muted);
  transition: var(--transition);
}
.mode-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.mode-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ===================== 상담 사이드바 ===================== */
.consult-sidebar { display: flex; flex-direction: column; gap: 16px; }

.consult-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px;
}
.consult-panel h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.consult-panel h4 i { color: var(--accent); }

.faq-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.faq-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  transition: var(--transition);
  border: 1px solid transparent;
}
.faq-list li:hover { background: var(--bg); border-color: var(--border); color: var(--accent); }
.faq-list li i { color: var(--accent); font-size: 10px; flex-shrink: 0; }
.no-docs { font-size: 12px; color: var(--text-muted); text-align: center; padding: 16px 0; }

/* ===================== 업로드 페이지 ===================== */
.upload-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
.upload-main { display: flex; flex-direction: column; gap: 20px; }

.upload-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
}
.upload-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.upload-card-header i { color: var(--accent); font-size: 18px; }
.upload-card-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }

.ai-drive-input {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-drive-input input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.ai-drive-input input:focus { border-color: var(--accent); }
.ai-drive-input button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: var(--transition);
}
.ai-drive-input button:hover { background: #2563eb; }

.ai-drive-preview {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
}

/* 업로드 폼 */
.upload-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.required { color: var(--danger); }
.ai-tag {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.form-group input, .form-group select, .form-group textarea {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  color: var(--text);
  background: var(--bg-card);
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.tag-input-wrap { display: flex; flex-direction: column; gap: 8px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.tag-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--accent);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
}
.tag-remove {
  cursor: pointer;
  font-size: 10px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}

.ai-analyze-btn-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ai-analyze-btn {
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.ai-analyze-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139,92,246,0.4); }
.ai-analyze-desc { font-size: 12px; color: var(--text-muted); }

.ai-analysis-result {
  background: linear-gradient(135deg, #faf5ff, #eff6ff);
  border: 1px solid #c4b5fd;
  border-radius: var(--radius);
  padding: 16px;
}
.ai-analysis-result h4 {
  font-size: 13px;
  font-weight: 700;
  color: #7c3aed;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ai-result-item label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 3px;
}
.ai-result-item p { font-size: 13px; color: var(--text); }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.btn-cancel {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}
.btn-cancel:hover { background: var(--bg); }
.btn-submit {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.btn-submit:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }

/* ===================== 업로드 가이드 ===================== */
.upload-sidebar { display: flex; flex-direction: column; gap: 16px; }
.guide-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}
.guide-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.guide-card h4 i { color: var(--accent); }

.guide-steps { display: flex; flex-direction: column; gap: 14px; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.step-num {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-text strong { font-size: 12px; font-weight: 700; color: var(--text); display: block; margin-bottom: 2px; }
.step-text p { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.file-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.file-type-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.file-type-item.pdf { background: rgba(239,68,68,0.08); color: #dc2626; }
.file-type-item.ppt { background: rgba(245,158,11,0.08); color: #d97706; }
.file-type-item.doc { background: rgba(59,130,246,0.08); color: #2563eb; }
.file-type-item.etc { background: rgba(100,116,139,0.08); color: #475569; }

/* ===================== 모달 ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 32px; height: 32px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  z-index: 1;
}
.modal-close:hover { background: var(--danger); color: #fff; }

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.modal-header .modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.modal-body { padding: 20px 24px 24px; }
.modal-section { margin-bottom: 20px; }
.modal-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.modal-section h4 i { color: var(--accent); }
.modal-section p { font-size: 13px; color: var(--text); line-height: 1.8; }
.modal-keywords { display: flex; flex-wrap: wrap; gap: 6px; }
.modal-keyword {
  background: rgba(59,130,246,0.1);
  color: var(--accent);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}
.modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.modal-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: var(--transition);
}
.modal-btn.primary { background: linear-gradient(135deg, var(--primary-light), var(--accent)); color: #fff; }
.modal-btn.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.modal-btn:hover { transform: translateY(-1px); }

/* ===================== 빈 상태 ===================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; opacity: 0.4; }
.empty-state p { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.empty-state span { font-size: 13px; }

/* ===================== 로딩 ===================== */
.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.loading-spinner i { color: var(--accent); }

/* ===================== 채팅 타이핑 효과 ===================== */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}
.typing-indicator span {
  width: 6px; height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ===================== AI 응답 포맷 ===================== */
.ai-response h4 { font-size: 13px; font-weight: 700; color: var(--text); margin: 12px 0 6px; }
.ai-response ul { padding-left: 16px; }
.ai-response ul li { font-size: 13px; line-height: 1.8; color: var(--text); }
.ai-response .response-section {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 8px 0;
}
.ai-response .tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ai-response .tag { 
  background: rgba(59,130,246,0.1);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}

/* ===================== 토스트 ===================== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  z-index: 300;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--accent); }

/* ===================== AI 분석 진행 ===================== */
.ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.ai-loading .progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.ai-loading .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 2px;
  animation: progress 2s ease-in-out infinite;
}
@keyframes progress {
  0% { width: 0%; }
  50% { width: 70%; }
  100% { width: 100%; }
}

/* ===================== 카테고리 배지 색상 ===================== */
.badge-보험상품 { background: rgba(102,126,234,0.12); color: #5b5bd6; }
.badge-약관 { background: rgba(240,147,251,0.12); color: #c026d3; }
.badge-보장분석 { background: rgba(79,172,254,0.12); color: #0284c7; }
.badge-영업자료 { background: rgba(67,233,123,0.12); color: #16a34a; }
.badge-교육자료 { background: rgba(250,112,154,0.12); color: #e11d48; }
.badge-회사소식지 { background: rgba(161,140,209,0.12); color: #7c3aed; }
.badge-기타자료 { background: rgba(150,251,196,0.12); color: #059669; }

/* ===================== 반응형 ===================== */
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-cards { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1024px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .logo-text,
  .sidebar .nav-item a span,
  .sidebar .nav-section-title span,
  .sidebar .nav-badge,
  .sidebar .system-info span { display: none; }
  .main-content { margin-left: var(--sidebar-collapsed); }
  .consult-layout { grid-template-columns: 1fr; }
  .upload-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar .logo-text,
  .sidebar .nav-item a span,
  .sidebar .nav-section-title span,
  .sidebar .nav-badge,
  .sidebar .system-info span { display: flex; }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .quick-search input { width: 140px; }
  .menu-cards { grid-template-columns: repeat(2, 1fr); }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-container { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .menu-cards { grid-template-columns: repeat(2, 1fr); }
  .ai-banner-search { flex-direction: column; }
  .search-big-wrap { flex-wrap: wrap; }
  .header-right .quick-search { display: none; }
}

/* ===================== 추가 UI 개선 ===================== */

/* 사이드바 호버 효과 */
.nav-item a { transition: all var(--transition); }

/* 문서 카드 파일 아이콘 스타일 수정 */
.doc-card-file-icon.pdf { background: rgba(239,68,68,0.1); color: #ef4444; }
.doc-card-file-icon.pptx, .doc-card-file-icon.ppt { background: rgba(245,158,11,0.1); color: #f59e0b; }
.doc-card-file-icon.docx, .doc-card-file-icon.doc { background: rgba(59,130,246,0.1); color: #3b82f6; }
.doc-card-file-icon { font-size: 22px; display: flex; align-items: center; justify-content: center; }

/* 검색 입력 포커스 */
.search-big-wrap input:focus { outline: none; }

/* 채팅 버블 코드 스타일 */
.chat-bubble code {
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}
.chat-message.ai .chat-bubble code {
  background: var(--border);
  color: var(--primary);
}

/* 대시보드 컬럼 헤더 */
.dashboard-col .section-title { margin-bottom: 12px; font-size: 14px; }

/* 상태 뱃지 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
}
.status-badge.done { background: rgba(16,185,129,0.12); color: var(--success); }
.status-badge.pending { background: rgba(245,158,11,0.12); color: var(--warning); }
.status-badge.error { background: rgba(239,68,68,0.12); color: var(--danger); }

/* 모달 스크롤 */
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-thumb { background: var(--border); }

/* 페이지 전환 부드럽게 */
.page { transition: none; }

/* 빈 상태 아이콘 애니메이션 */
.empty-state i { animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 툴팁 */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
[data-tooltip]:hover::after { opacity: 1; }

/* AI 분석 결과 그리드 고정 */
.ai-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-result-item label { font-size: 11px; font-weight: 600; color: var(--text-muted); display: block; margin-bottom: 4px; }
.ai-result-item p { font-size: 13px; color: var(--text); line-height: 1.6; }

/* 파일 타입 아이콘 색상 (doc-card 내) */
.doc-card-file-icon > div { width: 44px !important; height: 44px !important; }

/* 스크롤 맨 위로 */
.scroll-top-btn {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 40px; height: 40px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 99;
}
.scroll-top-btn.visible { opacity: 1; transform: translateY(0); }

/* 검색 입력 엔터 힌트 */
.search-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-top: 8px;
}

/* 반응형 AI 배너 */
@media (max-width: 600px) {
  .ai-banner { padding: 18px; }
  .ai-banner-content { flex-direction: column; gap: 10px; }
  .consult-layout { height: auto; }
  .chat-container { height: 70vh; }
}
