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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background-color: #ffffff;
            color: #1e293b;
            line-height: 1.6;
            overflow: hidden;
        }

        /* 로딩 스피너 애니메이션 */
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* 페이드 인 애니메이션 */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* 히스토리 아이템 애니메이션 */
        .history-item {
            animation: fadeIn 0.3s ease-out;
        }

        /* 메시지 애니메이션 */
        .message {
            animation: fadeIn 0.4s ease-out;
        }

        .app-container {
            display: flex;
            height: 100vh;
        }

        /* 왼쪽 사이드바 - 접을 수 있는 메뉴 */
        .left-sidebar {
            width: 280px;
            background-color: #1e293b;
            color: #ffffff;
            display: flex;
            flex-direction: column;
            transition: width 0.3s ease;
            overflow: hidden;
            min-width: 60px;
        }

        .left-sidebar.collapsed {
            width: 60px;
        }

        .sidebar-header {
            padding: 20px;
            border-bottom: 1px solid #374151;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .sidebar-title {
            font-size: 18px;
            font-weight: 600;
            opacity: 1;
            transition: opacity 0.3s ease;
        }

        .left-sidebar.collapsed .sidebar-title {
            display: none;
        }

        .sidebar-toggle {
            background: none;
            border: none;
            color: #ffffff;
            font-size: 18px;
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: background-color 0.2s ease;
        }

        .sidebar-toggle:hover {
            background-color: #374151;
        }

        .sidebar-nav {
            flex: 1;
            padding: 20px 0;
        }

        .nav-item {
            margin-bottom: 8px;
        }

        .nav-button {
            width: 100%;
            padding: 12px 20px;
            background: none;
            border: none;
            color: #cbd5e1;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: all 0.2s ease;
            text-align: left;
            white-space: nowrap;
            overflow: hidden;
            min-width: 0;
        }

        .nav-button:hover {
            background-color: #374151;
            color: #ffffff;
        }

        .nav-button.active {
            background-color: #3b82f6;
            color: #ffffff;
        }

        .nav-button i {
            width: 20px;
            text-align: center;
            font-size: 16px;
        }

        .nav-text {
            opacity: 1;
            transition: opacity 0.3s ease;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            min-width: 0;
            flex: 1;
        }

        .left-sidebar.collapsed .nav-text {
            display: none;
        }

        .left-sidebar.collapsed .nav-button {
            justify-content: center;
            padding: 12px;
        }

        .history-section {
            flex: 1;
            overflow-y: auto;
            padding: 0 20px;
        }

        .left-sidebar.collapsed .history-section {
            padding: 0;
        }

        .history-title {
            font-size: 12px;
            font-weight: 600;
            color: #64748b;
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            opacity: 1;
            transition: opacity 0.3s ease;
        }

        .left-sidebar.collapsed .history-title {
            display: none;
        }

        .history-item {
            padding: 8px 12px;
            margin-bottom: 4px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 13px;
            color: #cbd5e1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .history-item:hover {
            background-color: #374151;
            color: #ffffff;
        }

        .history-item.active {
            background-color: #3b82f6;
            color: #ffffff;
        }

        .history-actions {
            padding: 12px 0;
            border-top: 1px solid #374151;
            margin-top: 12px;
        }

        .all-chats-button {
            width: 100%;
            padding: 10px 12px;
            background: none;
            border: 1px solid #374151;
            color: #cbd5e1;
            font-size: 13px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s ease;
            text-align: left;
            border-radius: 6px;
            white-space: nowrap;
            overflow: hidden;
            min-width: 0;
        }

        .all-chats-button:hover {
            background-color: #374151;
            color: #ffffff;
            border-color: #4b5563;
        }

        .all-chats-button i {
            width: 16px;
            text-align: center;
            font-size: 14px;
        }

        .left-sidebar.collapsed .all-chats-button {
            justify-content: center;
            padding: 10px;
        }

        .left-sidebar.collapsed .all-chats-button .nav-text {
            display: none;
        }

        .left-sidebar.collapsed .history-item {
            display: none;
        }

        .left-sidebar.collapsed .history-actions {
            display: flex;
            justify-content: center;
            padding: 0;
            border-top: none;
            margin-top: 8px;
        }

        .left-sidebar.collapsed .all-chats-button {
            width: 44px;
            height: 44px;
            min-width: 44px;
            border-radius: 6px;
            justify-content: center;
            padding: 10px;
            margin: 0;
        }

        .left-sidebar.collapsed .all-chats-button .nav-text {
            display: none;
        }

        /* 메인 컨텐츠 영역 */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            background-color: #ffffff;
            height: 100vh;
            overflow: hidden;
        }

        .main-header {
            padding: 20px 24px;
            border-bottom: 1px solid #e2e8f0;
            background-color: #ffffff;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
        }

        /* 사용자 정보 영역 스타일 */
        .user-info-section {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .usage-info {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 4px;
            min-width: 100px;
        }

        .usage-text {
            font-size: 12px;
            color: #64748b;
            font-weight: 500;
        }

        .usage-progress {
            width: 100px;
            height: 4px;
            background: #f1f5f9;
            border-radius: 2px;
            overflow: hidden;
        }

        .usage-fill {
            height: 100%;
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            border-radius: 2px;
            transition: width 0.3s ease;
            width: 0%;
        }

        .usage-fill.high {
            background: linear-gradient(135deg, #f59e0b, #d97706);
        }

        .usage-fill.critical {
            background: linear-gradient(135deg, #ef4444, #dc2626);
        }

        /* 사용자 메뉴 스타일 */
        .user-menu {
            position: relative;
        }

        .user-button {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 16px;
            background: none;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 200px;
        }

        .user-button:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 14px;
        }

        .user-avatar.guest {
            background: linear-gradient(135deg, #64748b, #475569);
        }

        .user-avatar.user {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
        }

        .user-avatar.admin {
            background: linear-gradient(135deg, #10b981, #059669);
        }

        .user-info {
            flex: 1;
            text-align: left;
        }

        .user-name {
            display: block;
            font-size: 14px;
            font-weight: 600;
            color: #1e293b;
        }

        .user-level {
            display: block;
            font-size: 11px;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .user-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 8px;
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            min-width: 280px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .user-dropdown.show {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .dropdown-header {
            padding: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-avatar-large {
            width: 48px;
            height: 48px;
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 18px;
        }

        .dropdown-name {
            font-size: 16px;
            font-weight: 600;
            color: #1e293b;
        }

        .dropdown-email {
            font-size: 14px;
            color: #64748b;
        }

        .dropdown-divider {
            height: 1px;
            background: #f1f5f9;
            margin: 8px 0;
        }

        .dropdown-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 20px;
            color: #64748b;
            text-decoration: none;
            font-size: 14px;
            transition: all 0.3s ease;
            border: none;
            background: none;
            width: 100%;
            text-align: left;
            cursor: pointer;
        }

        .dropdown-item:hover {
            background: #f8fafc;
            color: #1e293b;
        }

        .dropdown-item i {
            width: 16px;
            text-align: center;
        }

        /* 반응형 디자인 */
        @media (max-width: 768px) {
            .main-header {
                padding: 16px 20px;
                flex-direction: column;
                gap: 16px;
                align-items: stretch;
            }

            .user-info-section {
                justify-content: space-between;
            }

            .user-button {
                min-width: auto;
                flex: 1;
            }

            .usage-info {
                min-width: 80px;
            }

            .user-dropdown {
                right: 0;
                left: 0;
                min-width: auto;
            }
        }
        
        @media (max-width: 480px) {
            .main-header {
                padding: 12px 16px;
            }

            .user-name,
            .user-level {
                display: none;
            }

            .user-button {
                min-width: 120px;
                justify-content: center;
            }

            .usage-text {
                font-size: 10px;
            }

            .usage-progress {
                width: 60px;
            }
        }

        .main-title {
            font-size: 24px;
            font-weight: 700;
            color: #1e293b;
        }

        .main-subtitle {
            font-size: 16px;
            color: #64748b;
            margin-top: 4px;
        }

        /* 채팅 화면 */
        .chat-view {
            display: flex;
            flex-direction: column;
            flex: 1;
            height: calc(100vh - 80px);
            position: relative;
            overflow: hidden;
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
            padding-bottom: 100px; /* 입력 영역 공간 확보 */
            background-color: #fafafa;
            min-height: 0; /* flex item이 overflow 되도록 허용 */
        }

        .welcome-screen {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            text-align: center;
            color: #64748b;
        }

        .welcome-icon {
            font-size: 48px;
            margin-bottom: 24px;
            color: #3b82f6;
        }

        .welcome-title {
            font-size: 24px;
            font-weight: 600;
            margin-bottom: 12px;
            color: #1e293b;
        }

        .welcome-subtitle {
            font-size: 16px;
            margin-bottom: 32px;
            color: #64748b;
        }

        .example-queries {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            max-width: 600px;
            width: 100%;
        }

        .example-query {
            background-color: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: left;
        }

        .example-query:hover {
            border-color: #3b82f6;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .example-query-title {
            font-size: 14px;
            font-weight: 500;
            color: #1e293b;
            margin-bottom: 4px;
        }

        .example-query-text {
            font-size: 12px;
            color: #64748b;
        }

        .message {
            margin-bottom: 32px;
            display: flex;
            align-items: flex-start;
            gap: 16px;
        }

        .user {
            flex-direction: row-reverse;
        }

        .message-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            font-size: 16px;
            flex-shrink: 0;
        }

        .user .message-avatar {
            background-color: #1e40af;
        }

        .assistant .message-avatar {
            background-color: #475569;
        }

        .message-content {
            max-width: 75%;
            padding: 14px 18px;
            border-radius: 16px;
            line-height: 1.6;
            word-wrap: break-word;
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
            border: 1px solid rgba(0,0,0,0.05);
        }

        .user .message-content {
            background: linear-gradient(135deg, #eff6ff, #dbeafe);
            color: #1e40af;
            border-bottom-right-radius: 6px;
            border: 1px solid rgba(59, 130, 246, 0.2);
        }

        .assistant .message-content {
            background: white;
            color: #334155;
            border-bottom-left-radius: 6px;
            border: 1px solid rgba(148, 163, 184, 0.2);
        }

        .message-text {
            font-size: 15px;
            line-height: 1.6;
            white-space: pre-wrap;
            color: #374151;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', 'Apple SD Gothic Neo', Roboto, sans-serif;
            word-break: break-word;
        }

        /* 사용자 메시지 텍스트 스타일 */
        .user .message-text {
            color: #1e40af;
            font-weight: 400;
        }

        /* 마크다운 렌더링된 내용의 공백 처리 */
        .assistant .message-text {
            white-space: normal;
            color: #334155;
            font-weight: 400;
        }

        /* 마크다운 스타일링 */
        .message-text h1,
        .message-text h2,
        .message-text h3,
        .message-text h4,
        .message-text h5,
        .message-text h6 {
            margin: 24px 0 12px 0;
            font-weight: 600;
            line-height: 1.3;
            color: #111827;
        }

        .message-text h1 { 
            font-size: 22px; 
            border-bottom: 2px solid #e5e7eb;
            padding-bottom: 8px;
        }
        .message-text h2 { 
            font-size: 20px; 
            border-bottom: 1px solid #e5e7eb;
            padding-bottom: 6px;
        }
        .message-text h3 { 
            font-size: 18px; 
            color: #1f2937;
        }
        .message-text h4 { 
            font-size: 16px; 
            color: #374151;
        }
        .message-text h5 { 
            font-size: 15px; 
            color: #374151;
        }
        .message-text h6 { 
            font-size: 14px; 
            color: #6b7280;
        }

        .message-text p {
            margin: 16px 0;
            line-height: 1.6;
        }

        .message-text p:first-child {
            margin-top: 0;
        }

        .message-text p:last-child {
            margin-bottom: 0;
        }

        /* 사용자 메시지에서 헤더 색상 조정 */
        .user .message-text h1,
        .user .message-text h2,
        .user .message-text h3,
        .user .message-text h4,
        .user .message-text h5,
        .user .message-text h6 {
            color: #1e40af;
            border-bottom-color: rgba(30, 64, 175, 0.3);
        }

        .message-text code {
            background-color: #f1f5f9;
            padding: 3px 6px;
            border-radius: 4px;
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
            font-size: 14px;
            color: #d63384;
            font-weight: 500;
        }

        .user .message-text code {
            background-color: rgba(30, 64, 175, 0.1);
            color: #1e40af;
        }

        .message-text pre {
            background-color: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            margin: 20px 0;
            overflow-x: auto;
            font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', 'Courier New', monospace;
            font-size: 14px;
            line-height: 1.5;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .user .message-text pre {
            background-color: rgba(30, 64, 175, 0.05);
            border-color: rgba(30, 64, 175, 0.2);
            box-shadow: 0 1px 3px rgba(30, 64, 175, 0.1);
        }

        .message-text pre code {
            background-color: transparent;
            padding: 0;
            border-radius: 0;
            font-size: 14px;
            color: inherit;
            font-weight: normal;
        }

        .message-text blockquote {
            border-left: 4px solid #3b82f6;
            background-color: #f8fafc;
            padding: 16px 20px;
            margin: 20px 0;
            font-style: italic;
            color: #475569;
            border-radius: 0 6px 6px 0;
            position: relative;
        }

        .message-text blockquote::before {
            content: '"';
            font-size: 48px;
            color: #3b82f6;
            position: absolute;
            left: 8px;
            top: -10px;
            line-height: 1;
            opacity: 0.3;
        }

        .user .message-text blockquote {
            border-left-color: rgba(30, 64, 175, 0.7);
            background-color: rgba(30, 64, 175, 0.05);
            color: #1e40af;
        }

        .user .message-text blockquote::before {
            color: rgba(30, 64, 175, 0.5);
        }

        .message-text ul,
        .message-text ol {
            padding-left: 24px;
            margin: 16px 0;
            line-height: 1.6;
        }

        .message-text li {
            margin: 8px 0;
            line-height: 1.6;
        }

        .message-text li:first-child {
            margin-top: 0;
        }

        .message-text li:last-child {
            margin-bottom: 0;
        }

        /* 중첩된 리스트 스타일 */
        .message-text ul ul,
        .message-text ol ol,
        .message-text ul ol,
        .message-text ol ul {
            margin: 6px 0;
        }

        .message-text table {
            border-collapse: collapse;
            width: 100%;
            margin: 20px 0;
            font-size: 14px;
            border-radius: 6px;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .message-text th,
        .message-text td {
            border: 1px solid #e5e7eb;
            padding: 12px 16px;
            text-align: left;
            line-height: 1.5;
        }

        .message-text th {
            background-color: #f8fafc;
            font-weight: 600;
            color: #374151;
        }

        .message-text tr:nth-child(even) {
            background-color: #f9fafb;
        }

        .user .message-text th {
            background-color: rgba(30, 64, 175, 0.1);
            color: #1e40af;
        }

        .user .message-text tr:nth-child(even) {
            background-color: rgba(30, 64, 175, 0.03);
        }

        .user .message-text th,
        .user .message-text td {
            border-color: rgba(30, 64, 175, 0.2);
        }

        .message-text a {
            color: #3b82f6;
            text-decoration: none;
        }

        .message-text a:hover {
            text-decoration: underline;
        }

        .user .message-text a {
            color: #1e40af;
            text-decoration: underline;
        }

        .message-text strong {
            font-weight: 600;
        }

        .message-text em {
            font-style: italic;
        }

        .message-text hr {
            border: none;
            border-top: 1px solid #e5e7eb;
            margin: 16px 0;
        }

        .user .message-text hr {
            border-top-color: rgba(30, 64, 175, 0.3);
        }

        .message-time {
            font-size: 12px;
            color: #64748b;
            margin-top: 12px;
            opacity: 0.8;
        }

        .user .message-time {
            color: rgba(30, 64, 175, 0.7);
        }

        .typing-message {
            animation: fadeIn 0.3s ease-in-out;
        }

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

        .typing-indicator-inline {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .typing-text {
            font-size: 14px;
            color: #64748b;
            font-style: italic;
        }

        .typing-dots {
            display: flex;
            gap: 4px;
        }

        .dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background-color: #64748b;
            animation: typing 1.4s infinite ease-in-out;
        }

        .dot:nth-child(1) { animation-delay: -0.32s; }
        .dot:nth-child(2) { animation-delay: -0.16s; }

        @keyframes typing {
            0%, 80%, 100% { opacity: 0.3; }
            40% { opacity: 1; }
        }

        .chat-input-container {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 20px 24px;
            border-top: 1px solid #e2e8f0;
            background-color: #ffffff;
            flex-shrink: 0;
            z-index: 10;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 12px;
        }

        .chat-input-wrapper {
            display: flex;
            gap: 12px;
            align-items: flex-end;
            flex: 1;
        }

        .chat-input {
            flex: 1;
            min-height: 44px;
            max-height: 120px;
            padding: 12px 16px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 14px;
            font-family: inherit;
            resize: none;
            outline: none;
            transition: all 0.2s ease;
        }

        .chat-input:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .send-btn {
            padding: 12px 16px;
            background-color: #3b82f6;
            color: #ffffff;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .send-btn:hover {
            background-color: #2563eb;
        }

        .send-btn:disabled {
            background-color: #cbd5e1;
            cursor: not-allowed;
        }

        /* 문서 관리 화면 */
        .document-view {
            display: none;
            flex: 1;
            padding: 24px;
            background-color: #fafafa;
            height: calc(100vh - 80px);
            overflow-y: auto;
        }

        .document-section {
            background-color: #ffffff;
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 24px;
            border: 1px solid #e2e8f0;
        }

        .section-title {
            font-size: 18px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 16px;
        }

        .upload-area {
            border: 2px dashed #cbd5e1;
            border-radius: 8px;
            padding: 40px;
            text-align: center;
            transition: all 0.3s ease;
            cursor: pointer;
            background-color: #f8fafc;
        }

        .upload-area:hover {
            border-color: #3b82f6;
            background-color: #eff6ff;
        }

        .upload-area.dragover {
            border-color: #3b82f6;
            background-color: #dbeafe;
        }

        .upload-icon {
            font-size: 48px;
            color: #64748b;
            margin-bottom: 16px;
        }

        .upload-text {
            font-size: 16px;
            color: #64748b;
            margin-bottom: 8px;
        }

        .upload-subtext {
            font-size: 14px;
            color: #94a3b8;
        }

        .file-input {
            display: none;
        }

        .upload-progress {
            margin-top: 20px;
            display: none;
        }

        .progress-bar {
            width: 100%;
            height: 8px;
            background-color: #e2e8f0;
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background-color: #3b82f6;
            transition: width 0.3s ease;
        }

        .progress-text {
            font-size: 14px;
            color: #64748b;
            margin-top: 12px;
        }

        .document-list {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 16px;
        }

        .document-item {
            background-color: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            transition: all 0.2s ease;
        }

        .document-item:hover {
            border-color: #3b82f6;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .document-info {
            display: flex;
            align-items: center;
            margin-bottom: 12px;
        }

        .document-icon {
            width: 40px;
            height: 40px;
            border-radius: 6px;
            background-color: #3b82f6;
            color: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            margin-right: 12px;
        }

        .document-details {
            flex: 1;
        }

        .document-name {
            font-size: 14px;
            font-weight: 500;
            color: #1e293b;
            margin-bottom: 4px;
        }

        .document-size {
            font-size: 12px;
            color: #64748b;
        }

        .document-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 4px;
        }

        .visibility-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .visibility-badge.personal {
            background-color: #f1f5f9;
            color: #475569;
            border: 1px solid #e2e8f0;
        }

        .visibility-badge.department {
            background-color: #dbeafe;
            color: #1e40af;
            border: 1px solid #93c5fd;
        }

        .visibility-badge i {
            font-size: 8px;
        }

        /* Processing Status Badge Styles */
        .processing-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 10px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            background-color: rgba(255, 255, 255, 0.8);
            border: 1px solid currentColor;
            opacity: 0.9;
            cursor: help;
        }

        .processing-status-badge i {
            font-size: 8px;
        }

        .processing-status-badge:hover {
            opacity: 1;
            transform: scale(1.05);
        }

        .document-actions {
            display: flex;
            gap: 8px;
        }

        .action-btn {
            padding: 8px 12px;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .action-btn.settings {
            background-color: #f8fafc;
            color: #64748b;
        }

        .action-btn.settings:hover {
            background-color: #f1f5f9;
            color: #1e293b;
        }

        .action-btn.download {
            background-color: #eff6ff;
            color: #3b82f6;
        }

        .action-btn.download:hover {
            background-color: #dbeafe;
        }

        .action-btn.delete {
            background-color: #fef2f2;
            color: #dc2626;
        }

        .action-btn.delete:hover {
            background-color: #fee2e2;
        }

        .action-btn.vector-preview {
            background-color: #f0f9ff;
            color: #0284c7;
        }

        .action-btn.vector-preview:hover {
            background-color: #e0f2fe;
            color: #0369a1;
        }

        /* 문서 설정 모달 */
        .document-settings-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .modal-content {
            background-color: #ffffff;
            border-radius: 12px;
            padding: 24px;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid #e2e8f0;
        }

        .modal-title {
            font-size: 18px;
            font-weight: 600;
            color: #1e293b;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 20px;
            color: #64748b;
            cursor: pointer;
            padding: 8px;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .modal-close:hover {
            background-color: #f1f5f9;
            color: #1e293b;
        }

        .modal-body {
            margin-bottom: 24px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 500;
            color: #374151;
            margin-bottom: 8px;
        }

        .form-input,
        .form-select {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 14px;
            color: #374151;
            background-color: #ffffff;
            transition: all 0.2s ease;
        }

        .form-input:focus,
        .form-select:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .form-input:disabled,
        .form-select:disabled {
            background-color: #f8fafc;
            color: #64748b;
            cursor: not-allowed;
            border-color: #e2e8f0;
        }

        .form-radio-group {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }

        .form-radio-option {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            padding: 8px 12px;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            background-color: #ffffff;
            transition: all 0.2s ease;
            flex: 1;
            min-width: 120px;
        }

        .form-radio-option:hover {
            border-color: #3b82f6;
            background-color: #eff6ff;
        }

        .form-radio-option input[type="radio"] {
            display: none;
        }

        .form-radio-custom {
            width: 16px;
            height: 16px;
            border: 2px solid #d1d5db;
            border-radius: 50%;
            position: relative;
            transition: all 0.2s ease;
        }

        .form-radio-option input[type="radio"]:checked + .form-radio-custom {
            border-color: #3b82f6;
            background-color: #3b82f6;
        }

        .form-radio-option input[type="radio"]:checked + .form-radio-custom::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 6px;
            height: 6px;
            background-color: #ffffff;
            border-radius: 50%;
        }

        .form-radio-text {
            font-size: 14px;
            color: #1e293b;
        }

        .form-radio-option input[type="radio"]:checked ~ .form-radio-text {
            color: #3b82f6;
            font-weight: 500;
        }

        .priority-slider-container {
            margin-top: 12px;
        }

        .priority-slider-value {
            display: block;
            text-align: center;
            font-size: 16px;
            font-weight: 600;
            color: #3b82f6;
            margin-bottom: 8px;
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            padding-top: 16px;
            border-top: 1px solid #e2e8f0;
        }

        .modal-btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .modal-btn.secondary {
            background-color: #f8fafc;
            color: #64748b;
            border: 1px solid #e2e8f0;
        }

        .modal-btn.secondary:hover {
            background-color: #f1f5f9;
            color: #1e293b;
        }

        .modal-btn.primary {
            background-color: #3b82f6;
            color: #ffffff;
        }

        .modal-btn.primary:hover {
            background-color: #2563eb;
        }

        .modal-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* 모달 반응형 디자인 */
        @media (max-width: 768px) {
            .modal-content {
                margin: 20px;
                max-width: none;
                width: calc(100% - 40px);
            }
            
            .form-radio-group {
                flex-direction: column;
                gap: 8px;
            }
            
            .form-radio-option {
                min-width: auto;
            }
            
            .modal-footer {
                flex-direction: column;
                gap: 8px;
            }
            
            .modal-btn {
                width: 100%;
            }
        }

        @media (max-width: 480px) {
            .modal-content {
                margin: 10px;
                width: calc(100% - 20px);
                padding: 20px;
            }
            
            .modal-title {
                font-size: 16px;
            }
            
            .form-label {
                font-size: 13px;
            }
            
            .form-input,
            .form-select {
                padding: 8px 10px;
                font-size: 13px;
            }
        }

        /* 알림 메시지 */
        .notification {
            position: fixed;
            top: 20px;
            right: 20px;
            background-color: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            z-index: 1001;
            display: none;
            min-width: 300px;
        }

        .notification.success {
            border-left: 4px solid #10b981;
        }

        .notification.error {
            border-left: 4px solid #dc2626;
        }

        .notification.warning {
            border-left: 4px solid #f59e0b;
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
        }

        .notification.info {
            border-left: 4px solid #3b82f6;
        }

        /* 로딩 스피너 */
        .loading-spinner {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid #e2e8f0;
            border-radius: 50%;
            border-top-color: #3b82f6;
            animation: spin 1s ease-in-out infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* 질의 범위 선택 스타일 */
        .query-scope-selector {
            padding: 4px 12px;
            background-color: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: nowrap;
            flex-shrink: 0;
        }

        .scope-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 500;
            color: #374151;
            white-space: nowrap;
        }

        .scope-label i {
            color: #64748b;
        }

        .scope-select {
            padding: 8px 12px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            background-color: #ffffff;
            font-size: 14px;
            color: #374151;
            cursor: pointer;
            outline: none;
            transition: all 0.2s ease;
            min-width: 120px;
        }

        .scope-select:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .scope-description {
            font-size: 12px;
            color: #64748b;
            font-style: italic;
            display: none; /* 공간 절약을 위해 설명 숨김 */
        }

        /* 업로드 옵션 스타일 */
        .upload-options {
            background-color: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            display: grid;
            gap: 20px;
        }

        .option-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .option-label {
            font-size: 14px;
            font-weight: 500;
            color: #374151;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .admin-only {
            font-size: 12px;
            color: #f59e0b;
            font-weight: 400;
        }

        /* 라디오 버튼 그룹 */
        .radio-group {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }

        .radio-option {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            cursor: pointer;
            padding: 12px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background-color: #ffffff;
            transition: all 0.2s ease;
            flex: 1;
            min-width: 200px;
        }

        .radio-option:hover {
            border-color: #3b82f6;
            background-color: #eff6ff;
        }

        .radio-option input[type="radio"] {
            display: none;
        }

        .radio-custom {
            width: 20px;
            height: 20px;
            border: 2px solid #d1d5db;
            border-radius: 50%;
            position: relative;
            transition: all 0.2s ease;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .radio-option input[type="radio"]:checked + .radio-custom {
            border-color: #3b82f6;
            background-color: #3b82f6;
        }

        .radio-option input[type="radio"]:checked + .radio-custom::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 8px;
            height: 8px;
            background-color: #ffffff;
            border-radius: 50%;
        }

        .radio-text {
            font-size: 14px;
            font-weight: 500;
            color: #1e293b;
            margin-bottom: 4px;
        }

        .radio-desc {
            font-size: 12px;
            color: #64748b;
            line-height: 1.3;
        }

        .radio-option input[type="radio"]:checked ~ .radio-text {
            color: #3b82f6;
        }

        /* 선택 박스 스타일 */
        .option-select {
            padding: 10px 12px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            background-color: #ffffff;
            font-size: 14px;
            color: #374151;
            cursor: pointer;
            outline: none;
            transition: all 0.2s ease;
        }

        .option-select:focus {
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        /* 우선순위 슬라이더 */
        .priority-slider {
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: #e2e8f0;
            outline: none;
            cursor: pointer;
            -webkit-appearance: none;
            transition: all 0.2s ease;
        }

        .priority-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #3b82f6;
            cursor: pointer;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            transition: all 0.2s ease;
        }

        .priority-slider::-webkit-slider-thumb:hover {
            background: #2563eb;
            transform: scale(1.1);
        }

        .priority-slider::-moz-range-thumb {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #3b82f6;
            cursor: pointer;
            border: none;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .priority-labels {
            display: flex;
            justify-content: space-between;
            margin-top: 8px;
            font-size: 12px;
            color: #64748b;
        }

        /* 반응형 디자인 */
        @media (max-width: 1024px) {
            .left-sidebar {
                width: 200px;
            }
            
            .nav-text {
                font-size: 13px;
            }
            
            .sidebar-title {
                font-size: 16px;
            }
            
            .nav-button {
                padding: 10px 16px;
            }
        }
        
        @media (max-width: 900px) {
            .left-sidebar {
                width: 150px;
            }
            
            .nav-text {
                font-size: 12px;
            }
            
            .sidebar-title {
                font-size: 14px;
            }
            
            .nav-button {
                padding: 8px 12px;
                gap: 8px;
            }
        }
        
        @media (max-width: 820px) {
            .left-sidebar {
                width: 60px;
            }
            
            .nav-text {
                opacity: 0;
                display: none;
            }
            
            .sidebar-title {
                opacity: 0;
                display: none;
            }
            
            .nav-button {
                justify-content: center;
                padding: 12px;
            }
            
            .history-section {
                padding: 0;
            }
            
            .history-title {
                opacity: 0;
                display: none;
            }
            
            .history-item {
                display: none;
            }
            
            .history-actions {
                display: flex;
                justify-content: center;
                padding: 0;
                border-top: none;
                margin-top: 8px;
            }
            
            .all-chats-button {
                width: 44px;
                height: 44px;
                min-width: 44px;
                border-radius: 6px;
                justify-content: center;
                padding: 10px;
                margin: 0;
            }
            
            .all-chats-button .nav-text {
                display: none;
            }
        }
        
        @media (max-width: 768px) {
            .left-sidebar {
                width: 60px;
            }
            
            .left-sidebar.collapsed {
                width: 60px;
            }
            
            .nav-text {
                opacity: 0;
                display: none;
            }
            
            .sidebar-title {
                opacity: 0;
                display: none;
            }
            
            .nav-button {
                justify-content: center;
                padding: 12px;
            }
            
            .history-section {
                padding: 0;
            }
            
            .history-title {
                opacity: 0;
                display: none;
            }
            
            .history-item {
                display: none;
            }
            
            .history-actions {
                display: flex;
                justify-content: center;
                padding: 0;
                border-top: none;
                margin-top: 8px;
            }
            
            .all-chats-button {
                width: 44px;
                height: 44px;
                min-width: 44px;
                border-radius: 6px;
                justify-content: center;
                padding: 10px;
                margin: 0;
            }
            
            .all-chats-button .nav-text {
                display: none;
            }
            
            .main-content {
                flex: 1;
            }
        }
        
        @media (max-width: 768px) {
            .chat-input-container {
                flex-direction: row;
                gap: 8px;
                align-items: center;
                padding-bottom: 70px;
            }

            .query-scope-selector {
                padding: 6px 8px;
                gap: 0;
                flex-shrink: 0;
            }

            .scope-label {
                display: none; /* 모바일에서는 라벨 숨김 */
            }

            .scope-select {
                min-width: 80px;
                padding: 8px 6px;
                font-size: 12px;
            }

            .chat-input-wrapper {
                flex: 1;
            }

            .upload-options {
                padding: 16px;
                gap: 16px;
            }

            .radio-group {
                flex-direction: column;
                gap: 12px;
            }

            .radio-option {
                min-width: auto;
            }
        }

        @media (max-width: 480px) {
            .left-sidebar {
                width: 50px;
            }
            
            .nav-button {
                padding: 10px;
            }
            
            .nav-button i {
                font-size: 14px;
            }
            
            .history-actions {
                display: flex;
                justify-content: center;
                padding: 0;
                border-top: none;
                margin-top: 8px;
            }
            
            .all-chats-button {
                width: 38px;
                height: 38px;
                min-width: 38px;
                border-radius: 6px;
                justify-content: center;
                padding: 8px;
                margin: 0;
            }
            
            .all-chats-button .nav-text {
                display: none;
            }
            
            .all-chats-button i {
                font-size: 12px;
            }

            .query-scope-selector {
                padding: 4px 6px;
                gap: 0;
            }

            .scope-label {
                display: none; /* 더 작은 화면에서도 라벨 숨김 */
            }

            .scope-select {
                padding: 6px 4px;
                font-size: 11px;
                min-width: 70px;
            }

            .upload-options {
                padding: 12px;
                gap: 12px;
            }

            .option-label {
                font-size: 13px;
            }

            .radio-text {
                font-size: 13px;
            }

            .radio-desc {
                font-size: 11px;
            }
        }

        /* 모든채팅 뷰 스타일 */
        .search-container {
            margin-bottom: 24px;
        }

        .search-input {
            position: relative;
            display: flex;
            align-items: center;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 12px 16px;
            gap: 12px;
        }

        .search-input i {
            color: #64748b;
            font-size: 16px;
        }

        .search-input input {
            flex: 1;
            background: none;
            border: none;
            outline: none;
            font-size: 14px;
            color: #1e293b;
        }

        .search-input input::placeholder {
            color: #94a3b8;
        }

        .search-input button {
            background: none;
            border: none;
            color: #64748b;
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            transition: all 0.2s ease;
        }

        .search-input button:hover {
            background: #e2e8f0;
            color: #1e293b;
        }

        .chat-cards-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }

        .chat-card {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 16px;
            cursor: pointer;
            transition: all 0.2s ease;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .chat-card:hover {
            border-color: #3b82f6;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
            transform: translateY(-2px);
        }

        .chat-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 8px;
        }

        .chat-card-title {
            font-size: 16px;
            font-weight: 600;
            color: #1e293b;
            margin: 0;
            line-height: 1.4;
            flex: 1;
            margin-right: 12px;
        }

        .chat-card-title mark {
            background: #fef3c7;
            color: #92400e;
            padding: 2px 4px;
            border-radius: 3px;
        }

        .chat-card-date {
            font-size: 12px;
            color: #64748b;
            white-space: nowrap;
        }

        .chat-card-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .chat-card-messages {
            font-size: 13px;
            color: #64748b;
        }

        .load-more-container {
            text-align: center;
            margin-top: 24px;
        }

        .load-more-button {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 12px 24px;
            color: #475569;
            cursor: pointer;
            font-size: 14px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s ease;
        }

        .load-more-button:hover {
            background: #e2e8f0;
            color: #1e293b;
        }

        .no-chats-message,
        .error-message {
            text-align: center;
            padding: 60px 20px;
        }

        .retry-button {
            background: #3b82f6;
            color: white;
            border: none;
            border-radius: 8px;
            padding: 10px 20px;
            cursor: pointer;
            font-size: 14px;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s ease;
        }

        .retry-button:hover {
            background: #2563eb;
        }

        @media (max-width: 768px) {
            .chat-cards-container {
                grid-template-columns: 1fr;
            }
            
            .chat-card-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }
            
            .chat-card-title {
                margin-right: 0;
            }
            
            .document-list {
                grid-template-columns: 1fr;
            }
            
            .document-meta {
                flex-direction: column;
                align-items: flex-start;
                gap: 4px;
            }
            
            .visibility-badge {
                font-size: 9px;
                padding: 2px 4px;
            }
        }

        /* 문서 검색 뷰 스타일 */
        .search-view {
            display: none;
            flex-direction: column;
            height: calc(100vh - 80px);
            overflow-y: auto;
            padding: 24px;
            background-color: #fafafa;
        }

        /* 검색 입력 섹션 */
        .search-input-section {
            background: white;
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .search-input-container {
            margin-top: 16px;
        }

        .search-input-wrapper {
            display: flex;
            gap: 12px;
            margin-bottom: 16px;
        }

        .search-input {
            flex: 1;
            padding: 12px 16px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            transition: all 0.3s ease;
        }

        .search-input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .search-btn {
            padding: 12px 24px;
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .search-btn:hover {
            background: linear-gradient(135deg, #2563eb, #1e40af);
            transform: translateY(-1px);
        }

        /* 🚀 검색범위 선택기 스타일 제거됨 - UI 단순화 완료 */



        /* 검색 결과 섹션 */
        .search-results-section {
            background: white;
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            flex: 1;
        }

        .results-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid #e2e8f0;
        }

        .results-info {
            font-weight: 500;
            color: #475569;
        }

        .results-actions {
            display: flex;
            gap: 12px;
        }

        .results-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            color: #64748b;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .results-btn:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
            color: #475569;
        }

        /* 검색 결과 리스트 */
        .search-results-list {
            min-height: 400px;
        }

        /* 검색 환영 화면 */
        .search-welcome {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 400px;
            text-align: center;
        }

        .search-welcome-icon {
            font-size: 48px;
            color: #3b82f6;
            margin-bottom: 20px;
        }

        .search-welcome-title {
            font-size: 24px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 8px;
        }

        .search-welcome-subtitle {
            font-size: 16px;
            color: #64748b;
            margin-bottom: 32px;
        }

        .search-welcome-tips {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .tip-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: #f8fafc;
            border-radius: 8px;
            font-size: 14px;
            color: #475569;
        }

        .tip-item i {
            color: #3b82f6;
            width: 16px;
        }

        /* 로딩 상태 */
        .search-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 200px;
        }

        .loading-spinner {
            width: 32px;
            height: 32px;
            border: 3px solid #e5e7eb;
            border-top: 3px solid #3b82f6;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 16px;
        }

        .loading-text {
            font-size: 14px;
            color: #64748b;
        }

        /* 빈 결과 상태 */
        .search-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 300px;
            text-align: center;
        }

        .empty-icon {
            font-size: 48px;
            color: #9ca3af;
            margin-bottom: 20px;
        }

        .empty-title {
            font-size: 20px;
            font-weight: 600;
            color: #374151;
            margin-bottom: 8px;
        }

        .empty-subtitle {
            font-size: 14px;
            color: #6b7280;
        }

        /* 검색 결과 카드 */
        .search-result-card {
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 16px;
            background: white;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .search-result-card:hover {
            border-color: #3b82f6;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
            transform: translateY(-2px);
        }

        .search-result-card:last-child {
            margin-bottom: 0;
        }

        .result-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 12px;
        }

        .result-card-title {
            font-size: 18px;
            font-weight: 600;
            color: #1e293b;
            margin: 0;
            line-height: 1.4;
        }

        .result-card-score {
            background: #f0f9ff;
            color: #0369a1;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
        }

        .result-card-content {
            color: #475569;
            font-size: 14px;
            line-height: 1.6;
            margin-bottom: 16px;
        }

        .result-card-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 16px;
        }

        .meta-item {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            color: #64748b;
        }

        .meta-item i {
            width: 12px;
        }

        .result-card-actions {
            display: flex;
            gap: 8px;
        }

        .result-action-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 4px;
            color: #475569;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .result-action-btn:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }

        .result-action-btn.primary {
            background: #3b82f6;
            border-color: #3b82f6;
            color: white;
        }

        .result-action-btn.primary:hover {
            background: #2563eb;
        }

        /* 페이지네이션 */
        .search-pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            padding: 20px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .pagination-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            color: #475569;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .pagination-btn:hover:not(:disabled) {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }

        .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pagination-info {
            padding: 8px 16px;
            font-size: 14px;
            color: #475569;
            font-weight: 500;
        }

        /* 반응형 디자인 */
        @media (max-width: 768px) {
            .search-view {
                padding: 16px;
            }

            .search-input-wrapper {
                flex-direction: column;
            }

            .search-btn {
                align-self: stretch;
                justify-content: center;
            }

            /* 🚀 반응형 검색범위 선택기 스타일 제거됨 */

            .results-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 12px;
            }

            .result-card-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }

            .result-card-meta {
                flex-direction: column;
                gap: 8px;
            }

            .result-card-actions {
                flex-wrap: wrap;
            }

            .pagination-btn {
                padding: 6px 12px;
                font-size: 12px;
            }

            .search-welcome-tips {
                align-items: stretch;
            }

            .tip-item {
                text-align: left;
            }
        }

        .modal-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* 문서 상세보기 모달 */
        .document-details-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .details-modal-content {
            background-color: #ffffff;
            border-radius: 12px;
            padding: 24px;
            max-width: 700px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
        }

        .details-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid #e2e8f0;
        }

        .details-title {
            font-size: 20px;
            font-weight: 600;
            color: #1e293b;
            line-height: 1.3;
            margin-right: 20px;
            flex: 1;
        }

        .details-score {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            color: white;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 500;
            white-space: nowrap;
        }

        .details-body {
            margin-bottom: 24px;
        }

        .details-section {
            margin-bottom: 24px;
        }

        .details-section-title {
            font-size: 16px;
            font-weight: 600;
            color: #374151;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .details-section-title i {
            color: #3b82f6;
        }

        .details-content-preview {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 16px;
            font-size: 14px;
            color: #475569;
            line-height: 1.6;
            max-height: 200px;
            overflow-y: auto;
            white-space: pre-wrap;
        }

        .details-meta-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 16px;
        }

        .details-meta-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px;
            background: #f8fafc;
            border-radius: 8px;
            border: 1px solid #e2e8f0;
        }

        .details-meta-item i {
            color: #3b82f6;
            font-size: 16px;
            min-width: 16px;
        }

        .details-meta-label {
            font-weight: 500;
            color: #64748b;
            min-width: 60px;
        }

        .details-meta-value {
            color: #1e293b;
            flex: 1;
        }

        .details-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }

        .details-tag {
            background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
            color: #475569;
            padding: 4px 12px;
            border-radius: 16px;
            font-size: 12px;
            font-weight: 500;
            border: 1px solid #cbd5e1;
        }

        .details-actions {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
            padding-top: 16px;
            border-top: 1px solid #e2e8f0;
        }

        .details-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            text-decoration: none;
        }

        .details-btn.primary {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            color: white;
        }

        .details-btn.primary:hover {
            background: linear-gradient(135deg, #2563eb, #1e40af);
            transform: translateY(-1px);
        }

        .details-btn.secondary {
            background: #f8fafc;
            color: #475569;
            border: 1px solid #cbd5e1;
        }

        .details-btn.secondary:hover {
            background: #f1f5f9;
            border-color: #94a3b8;
        }

        .details-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px;
            color: #64748b;
        }

        .details-loading .spinner {
            width: 32px;
            height: 32px;
            border: 3px solid #e2e8f0;
            border-top: 3px solid #3b82f6;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 16px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .details-error {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 40px;
            text-align: center;
            color: #64748b;
        }

        .details-error i {
            font-size: 48px;
            color: #ef4444;
            margin-bottom: 16px;
        }

        .details-error-title {
            font-size: 18px;
            font-weight: 600;
            color: #374151;
            margin-bottom: 8px;
        }

        .details-error-message {
            font-size: 14px;
            color: #6b7280;
        }

        /* 🚀 문서 단위 검색 결과 카드 스타일 */
        .document-search-card {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            transition: all 0.2s ease;
        }

        .document-search-card:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            border-color: #cbd5e1;
            transform: translateY(-1px);
        }

        .document-card-header {
            margin-bottom: 20px;
        }

        .document-title-section {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 16px;
        }

        .document-card-title {
            font-size: 18px;
            font-weight: 600;
            color: #1e293b;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
            line-height: 1.4;
        }

        .document-card-title i {
            color: #3b82f6;
            font-size: 16px;
            flex-shrink: 0;
        }

        .document-card-badges {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
        }

        .score-badge {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
        }

        .category-badge {
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
        }

        .category-badge.category-official {
            background: #fef3c7;
            color: #d97706;
        }

        .category-badge.category-personal {
            background: #dbeafe;
            color: #2563eb;
        }

        .category-badge.category-department {
            background: #e7e5e4;
            color: #78716c;
        }

        .chunks-badge {
            background: #f1f5f9;
            color: #475569;
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
            white-space: nowrap;
        }

        .document-info-grid {
            margin-bottom: 20px;
        }

        .info-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            margin-bottom: 16px;
        }

        .info-row:last-child {
            margin-bottom: 0;
        }

        .info-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .info-icon {
            color: #64748b;
            font-size: 14px;
            margin-top: 2px;
            flex-shrink: 0;
        }

        .info-content {
            flex: 1;
            min-width: 0;
        }

        .info-label {
            display: block;
            font-size: 12px;
            color: #64748b;
            font-weight: 500;
            margin-bottom: 2px;
        }

        .info-value {
            display: block;
            font-size: 14px;
            color: #1e293b;
            font-weight: 500;
            word-break: break-word;
        }

        .document-tags-section {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
            padding-top: 16px;
            border-top: 1px solid #f1f5f9;
        }

        .tags-icon {
            color: #64748b;
            font-size: 14px;
            flex-shrink: 0;
        }

        .document-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            flex: 1;
        }

        .document-tag {
            background: #f8fafc;
            color: #475569;
            padding: 4px 10px;
            border-radius: 16px;
            font-size: 12px;
            font-weight: 500;
            border: 1px solid #e2e8f0;
        }

        .document-actions {
            display: flex;
            gap: 12px;
            padding-top: 16px;
            border-top: 1px solid #f1f5f9;
        }

        .document-action-btn {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 16px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            background: white;
            color: #64748b;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            text-decoration: none;
        }

        .document-action-btn:hover {
            background: #f8fafc;
            border-color: #cbd5e1;
            color: #475569;
        }

        .document-action-btn.primary {
            background: #3b82f6;
            color: white;
            border-color: #3b82f6;
        }

        .document-action-btn.primary:hover {
            background: #2563eb;
            border-color: #2563eb;
        }

        .document-action-btn i {
            font-size: 12px;
        }

        /* 반응형 디자인 */
        @media (max-width: 768px) {
            .document-search-card {
                padding: 16px;
            }

            .document-title-section {
                flex-direction: column;
                gap: 12px;
            }

            .document-card-title {
                font-size: 16px;
            }

            .info-row {
                grid-template-columns: 1fr;
                gap: 16px;
            }

            .document-actions {
                flex-direction: column;
            }
        }

/* 참고자료 섹션 스타일 - 컴팩트 디자인 */
.reference-section {
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.reference-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.reference-header i {
    font-size: 14px;
    color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 4px;
    border-radius: 4px;
}

.reference-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.025em;
}

.reference-count {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.reference-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reference-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.reference-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.12);
    transform: translateY(-1px);
}

.reference-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 12px;
}

.reference-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.reference-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 14px;
    flex-shrink: 0;
}

.reference-file-icon .fa-file-pdf {
    color: #dc2626;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.reference-file-icon .fa-file-word {
    color: #2563eb;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.reference-file-icon .fa-file-excel {
    color: #16a34a;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.reference-file-icon .fa-file-powerpoint {
    color: #ea580c;
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
}

.reference-file-icon .fa-file-alt,
.reference-file-icon .fa-file {
    color: #6b7280;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.reference-file-details {
    flex: 1;
    min-width: 0;
}

.reference-file-name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.reference-file-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.reference-page {
    font-size: 11px;
    color: #475569;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.reference-score {
    font-size: 11px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.reference-download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2);
}

.reference-download-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.reference-download-btn:active {
    transform: translateY(0);
}

.reference-download-btn i {
    font-size: 11px;
}

.download-text {
    font-weight: 600;
}

/* 반응형 디자인 - 참고자료 섹션 */
@media (max-width: 768px) {
    .reference-section {
        margin-top: 14px;
        padding: 10px;
    }
    
    .reference-header {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }
    
    .reference-header i {
        font-size: 13px;
        padding: 3px;
    }
    
    .reference-title {
        font-size: 13px;
    }
    
    .reference-count {
        font-size: 11px;
        padding: 2px 5px;
    }
    
    .reference-list {
        gap: 5px;
    }
    
    .reference-content {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 10px;
    }
    
    .reference-file-info {
        gap: 8px;
    }
    
    .reference-file-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .reference-file-name {
        font-size: 12px;
    }
    
    .reference-file-meta {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }
    
    .reference-download-btn {
        align-self: center;
        padding: 5px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .reference-section {
        padding: 8px;
        margin-top: 12px;
    }
    
    .reference-content {
        padding: 6px 8px;
    }
    
    .reference-file-info {
        gap: 6px;
    }
    
    .reference-file-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .reference-file-name {
        font-size: 11px;
    }
    
    .reference-page,
    .reference-score {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .reference-download-btn {
        padding: 4px 6px;
        font-size: 10px;
    }
}

/* 채팅 인터페이스 로딩 중 표시 개선 */
.chat-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* 🔥 관련 문서 표시 UI 스타일 */
.related-documents {
    margin: 12px 0 8px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.related-docs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.related-docs-header:hover {
    background-color: #e2e8f0;
}

.related-docs-header i.fas {
    color: #64748b;
    margin-right: 8px;
}

.related-docs-header span {
    flex: 1;
    font-weight: 500;
    color: #475569;
    font-size: 0.9rem;
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: #64748b;
}

.related-docs-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.related-docs-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.related-docs-content.expanded {
    max-height: 400px;
    opacity: 1;
    padding: 8px 0;
}

.related-doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.related-doc-item:last-child {
    border-bottom: none;
}

.related-doc-item:hover {
    background-color: #f1f5f9;
}

.doc-info {
    flex: 1;
    margin-right: 12px;
}

.doc-name {
    font-weight: 500;
    color: #334155;
    font-size: 0.9rem;
    margin-bottom: 4px;
    line-height: 1.4;
}

.doc-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.doc-dept, .doc-type, .doc-score {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #e2e8f0;
    color: #64748b;
}

.doc-dept {
    background-color: #dbeafe;
    color: #1e40af;
}

.doc-type {
    background-color: #dcfce7;
    color: #16a34a;
}

.doc-score {
    background-color: #fef3c7;
    color: #d97706;
}

.doc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-preview-btn,
.doc-download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.doc-preview-btn {
    background-color: #e0e7ff;
    color: #3730a3;
}

.doc-preview-btn:hover {
    background-color: #c7d2fe;
    color: #312e81;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.doc-download-btn {
    background-color: #3b82f6;
    color: white;
}

.doc-download-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.doc-preview-btn:active,
.doc-download-btn:active {
    transform: translateY(0);
}

.doc-preview-btn i,
.doc-download-btn i {
    font-size: 0.75rem;
}

/* 참고자료 섹션 버튼 스타일 */
.reference-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.reference-preview-btn,
.reference-download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.reference-preview-btn {
    background-color: #e0e7ff;
    color: #3730a3;
}

.reference-preview-btn:hover {
    background-color: #c7d2fe;
    color: #312e81;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}

.reference-download-btn {
    background-color: #3b82f6;
    color: white;
}

.reference-download-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.reference-preview-btn:active,
.reference-download-btn:active {
    transform: translateY(0);
}

.reference-preview-btn i,
.reference-download-btn i {
    font-size: 0.75rem;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .related-doc-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .doc-download-btn {
        align-self: flex-end;
        width: auto;
    }
    
    .doc-meta {
        font-size: 0.7rem;
    }
}

        .left-sidebar.collapsed .nav-button {
            justify-content: center;
        }

        /* 탭 네비게이션 스타일 */
        .tab-navigation {
            display: flex;
            border-bottom: 2px solid #e5e7eb;
            margin-bottom: 24px;
            background-color: #ffffff;
        }

        .tab-button {
            flex: 1;
            padding: 16px 24px;
            background: none;
            border: none;
            color: #6b7280;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.3s ease;
            border-bottom: 3px solid transparent;
            position: relative;
        }

        .tab-button:hover {
            color: #3b82f6;
            background-color: #f8fafc;
        }

        .tab-button.active {
            color: #3b82f6;
            border-bottom-color: #3b82f6;
            background-color: #ffffff;
        }

        .tab-button i {
            font-size: 16px;
        }

        /* 탭 컨텐츠 영역 */
        .tab-content {
            position: relative;
        }

        .tab-panel {
            display: none;
            animation: fadeIn 0.3s ease-out;
        }

        .tab-panel.active {
            display: block;
        }

        /* 텍스트 입력 폼 스타일 */
        .text-input-form {
            background-color: #ffffff;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 16px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group:last-child {
            margin-bottom: 0;
        }

        .form-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            margin-bottom: 8px;
        }

        .form-label i {
            color: #6b7280;
            font-size: 16px;
        }

        .text-title-input {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            font-size: 14px;
            color: #1f2937;
            background-color: #ffffff;
            transition: all 0.2s ease;
        }

        .text-title-input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .text-content-input {
            width: 100%;
            padding: 16px;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            font-size: 14px;
            color: #1f2937;
            background-color: #ffffff;
            resize: vertical;
            min-height: 200px;
            font-family: inherit;
            line-height: 1.5;
            transition: all 0.2s ease;
        }

        .text-content-input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .input-help {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
            font-size: 12px;
            color: #6b7280;
        }

        .input-help i {
            color: #9ca3af;
        }

        .form-actions {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
            margin-top: 24px;
        }

        .text-upload-btn {
            padding: 12px 24px;
            background-color: #3b82f6;
            color: #ffffff;
            border: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s ease;
        }

        .text-upload-btn:hover {
            background-color: #2563eb;
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
        }

        .text-upload-btn:active {
            transform: translateY(0);
        }

        .text-clear-btn {
            padding: 12px 24px;
            background-color: #ffffff;
            color: #6b7280;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.2s ease;
        }

        .text-clear-btn:hover {
            color: #ef4444;
            border-color: #ef4444;
            background-color: #fef2f2;
        }

        /* 반응형 디자인 */
        @media (max-width: 768px) {
            .tab-navigation {
                flex-direction: column;
            }

            .tab-button {
                border-bottom: none;
                border-right: 3px solid transparent;
                justify-content: flex-start;
                padding: 12px 16px;
            }

            .tab-button.active {
                border-bottom: none;
                border-right-color: #3b82f6;
            }

            .text-input-form {
                padding: 16px;
            }

            .form-actions {
                flex-direction: column;
            }

            .text-upload-btn,
            .text-clear-btn {
                width: 100%;
                justify-content: center;
            }
        }

        @media (max-width: 480px) {
            .tab-button span {
                display: none;
            }
        }

        /* 통합 문서 목록 스타일 */
        .unified-document {
            position: relative;
            transition: all 0.3s ease;
        }

        .unified-document::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background-color: transparent;
            transition: background-color 0.3s ease;
        }

        .unified-document[data-type="file"]::before {
            background-color: #3b82f6;
        }

        .unified-document[data-type="text"]::before {
            background-color: #8b5cf6;
        }

        .document-type-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            color: white;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .document-type-badge i {
            font-size: 10px;
        }

        .document-preview {
            font-size: 13px;
            color: #6b7280;
            margin-top: 4px;
            line-height: 1.4;
            max-height: 2.8em;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .document-date {
            font-size: 12px;
            color: #9ca3af;
            font-weight: 500;
        }

        .document-meta {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
            margin-top: 8px;
        }

        .processing-status-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            font-weight: 600;
            padding: 4px 8px;
            border-radius: 8px;
            background-color: rgba(0, 0, 0, 0.05);
        }

        .processing-status-badge i {
            font-size: 11px;
        }

        /* 액션 버튼 확장 */
        .action-btn.edit {
            background-color: #eff6ff;
            color: #3b82f6;
        }

        .action-btn.edit:hover {
            background-color: #dbeafe;
        }

        .action-btn.preview {
            background-color: #f0f9ff;
            color: #0284c7;
        }

        .action-btn.preview:hover {
            background-color: #e0f2fe;
        }

        /* 문서 아이콘 개선 */
        .document-icon {
            font-size: 24px;
            margin-right: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 48px;
            border-radius: 8px;
            background-color: rgba(0, 0, 0, 0.05);
            transition: all 0.3s ease;
        }

        .unified-document:hover .document-icon {
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        /* 호버 효과 개선 */
        .unified-document:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        }

        /* 반응형 개선 */
        @media (max-width: 768px) {
            .document-meta {
                flex-direction: column;
                align-items: flex-start;
                gap: 8px;
            }
            
            .document-actions {
                flex-direction: column;
                gap: 8px;
            }
            
            .action-btn {
                width: 100%;
                justify-content: center;
            }
        }

        @media (max-width: 480px) {
            .document-icon {
                width: 40px;
                height: 40px;
                font-size: 20px;
                margin-right: 12px;
            }
            
            .document-preview {
                font-size: 12px;
                -webkit-line-clamp: 1;
                max-height: 1.4em;
            }
        }

        /* ================================== */
        /* 문서 미리보기 모달 스타일 */
        /* ================================== */

        .document-preview-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease-out;
        }

        .preview-modal-content {
            background: white;
            border-radius: 12px;
            max-width: 800px;
            max-height: 90vh;
            width: 90%;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }

        .preview-modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
        }

        /* 미리보기 로딩 상태 */
        .preview-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px;
        }

        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #e5e7eb;
            border-top: 4px solid #3b82f6;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 16px;
        }

        .loading-text {
            color: #6b7280;
            font-size: 14px;
        }

        /* 미리보기 헤더 */
        .preview-header {
            margin-bottom: 24px;
            border-bottom: 1px solid #e5e7eb;
            padding-bottom: 16px;
        }

        .preview-document-info {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .preview-document-icon {
            width: 48px;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            background-color: #f3f4f6;
            font-size: 20px;
        }

        .preview-document-details h4 {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
            color: #1f2937;
        }

        .preview-document-meta {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }

        .preview-meta-item {
            font-size: 12px;
            color: #6b7280;
            background-color: #f9fafb;
            padding: 4px 8px;
            border-radius: 4px;
        }

        /* 미리보기 컨텐츠 */
        .preview-text-content {
            background-color: #f9fafb;
            border-radius: 8px;
            padding: 20px;
        }

        .preview-text-body {
            line-height: 1.6;
            color: #374151;
            white-space: pre-wrap;
            max-height: 400px;
            overflow-y: auto;
            font-family: 'Courier New', monospace;
        }

        /* 파일 정보 표시 */
        .preview-file-info {
            background-color: #f9fafb;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 16px;
        }

        .file-info-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid #e5e7eb;
        }

        .file-info-item:last-child {
            border-bottom: none;
        }

        .file-info-label {
            font-weight: 500;
            color: #374151;
        }

        .file-info-value {
            color: #6b7280;
        }

        .preview-file-actions {
            text-align: center;
        }

        .preview-action-btn {
            background-color: #3b82f6;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            transition: background-color 0.2s;
        }

        .preview-action-btn:hover {
            background-color: #2563eb;
        }

        /* 미리보기 에러 상태 */
        .preview-error {
            text-align: center;
            padding: 60px;
        }

        .preview-error .error-icon {
            font-size: 48px;
            color: #ef4444;
            margin-bottom: 16px;
        }

        .preview-error .error-title {
            font-size: 18px;
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 8px;
        }

        .preview-error .error-message {
            color: #6b7280;
        }

        /* ================================== */
        /* 문서 편집 모달 스타일 */
        /* ================================== */

        .document-edit-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease-out;
        }

        .edit-modal-content {
            background: white;
            border-radius: 12px;
            max-width: 900px;
            max-height: 90vh;
            width: 90%;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }

        .edit-modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
        }

        /* 편집 로딩 상태 */
        .edit-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px;
        }

        /* 편집 폼 스타일 */
        #documentEditForm {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .form-group {
            display: flex;
            flex-direction: column;
        }

        .form-label {
            font-weight: 500;
            color: #374151;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .form-input {
            padding: 12px;
            border: 1px solid #d1d5db;
            border-radius: 6px;
            font-size: 14px;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .form-input:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .edit-content-textarea {
            min-height: 200px;
            resize: vertical;
            font-family: 'Courier New', monospace;
            line-height: 1.5;
        }

        .input-help {
            font-size: 12px;
            color: #6b7280;
            margin-top: 4px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }



        /* 편집 에러 상태 */
        .edit-error {
            text-align: center;
            padding: 60px;
        }

        .edit-error .error-icon {
            font-size: 48px;
            color: #ef4444;
            margin-bottom: 16px;
        }

        .edit-error .error-title {
            font-size: 18px;
            font-weight: 600;
            color: #1f2937;
            margin-bottom: 8px;
        }

        .edit-error .error-message {
            color: #6b7280;
        }
