

/* =========================================================
   FreshVault AI 학습 관리
   - 학습 입력 / AI 해석 2단 구성
   - 기존 FreshVault 그린 톤 유지
   ========================================================= */


/* AI 페이지 전체 */
.freshvault-ai-page {
    width: 100%;
    padding: 18px 22px 28px;
    box-sizing: border-box;
}


/* =========================================================
   상단 탭
   ========================================================= */

.ai-learning-tabs {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px;
    margin-bottom: 18px;

    background: #eef4f0;
    border: 1px solid #d9e5dd;
    border-radius: 12px;
}

.ai-learning-tab {
    min-width: 110px;
    height: 40px;

    padding: 0 18px;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: #53645b;

    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
    transition: all 0.18s ease;
}

.ai-learning-tab:hover {
    background: #e0ebe4;
    color: #31483a;
}

.ai-learning-tab.active {
    background: #3f6652;
    color: #ffffff;

    box-shadow: 0 2px 7px rgba(46, 82, 62, 0.16);
}


/* =========================================================
   좌우 작업 영역
   ========================================================= */

.ai-learning-workspace {
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    gap: 18px;

    align-items: stretch;
}


/* =========================================================
   공통 패널 카드
   ========================================================= */

.ai-learning-panel {
    min-height: 520px;

    padding: 22px;

    background: #ffffff;

    border: 1px solid #dfe7e2;
    border-radius: 14px;

    box-shadow: 0 4px 16px rgba(44, 69, 55, 0.06);

    box-sizing: border-box;
}


/* 패널 제목 */
.ai-learning-panel-header {
    padding-bottom: 16px;
    margin-bottom: 18px;

    border-bottom: 1px solid #edf1ee;
}

.ai-learning-panel-header h3 {
    margin: 0 0 5px;

    color: #263c31;

    font-size: 19px;
    font-weight: 800;
}

.ai-learning-panel-header span {
    color: #7a8981;

    font-size: 13px;
    font-weight: 500;
}


/* =========================================================
   학습 종류 버튼
   ========================================================= */

.ai-learning-type-row {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;

    margin-bottom: 14px;
}

.ai-learning-type {
    height: 34px;

    padding: 0 15px;

    border: 1px solid #d5e0d9;
    border-radius: 18px;

    background: #f7faf8;
    color: #5d6f64;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.ai-learning-type:hover {
    background: #edf4ef;
}

.ai-learning-type.active {
    border-color: #769c86;

    background: #dfece4;
    color: #315542;
}


/* =========================================================
   학습 입력 textarea
   ========================================================= */

.ai-learning-textarea {
    width: 100%;
    height: 230px;

    padding: 18px;

    resize: vertical;

    border: 1px solid #d9e3dd;
    border-radius: 12px;

    background: #fbfdfc;
    color: #2b3831;

    font-size: 15px;
    line-height: 1.7;

    box-sizing: border-box;

    outline: none;
}

.ai-learning-textarea::placeholder {
    color: #9aa7a0;
}

.ai-learning-textarea:focus {
    border-color: #719782;

    background: #ffffff;

    box-shadow: 0 0 0 3px rgba(74, 119, 91, 0.09);
}


/* =========================================================
   파일 첨부 박스
   ========================================================= */

.ai-learning-file-box {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 76px;

    margin-top: 14px;

    border: 1px dashed #aec1b5;
    border-radius: 10px;

    background: #f7faf8;
    color: #73847a;

    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   AI 분석 버튼
   ========================================================= */

.ai-learning-analyze-btn {
    width: 100%;
    height: 44px;

    margin-top: 14px;

    border: none;
    border-radius: 9px;

    background: #3f6652;
    color: #ffffff;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    transition: all 0.18s ease;
}

.ai-learning-analyze-btn:hover {
    background: #345846;

    transform: translateY(-1px);
}


/* =========================================================
   오른쪽 AI 해석 패널
   ========================================================= */

.ai-learning-result-panel {
    display: flex;
    flex-direction: column;
}


/* 분석 전 빈 상태 */
.ai-learning-empty {
    flex: 1;

    min-height: 330px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    border-radius: 12px;

    background: #fafcfb;

    padding: 30px;

    box-sizing: border-box;
}


/* AI 원형 아이콘 */
.ai-learning-empty-icon {
    width: 60px;
    height: 60px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 50%;

    background: #e3eee7;
    color: #3e6953;

    font-size: 16px;
    font-weight: 900;

    letter-spacing: 1px;
}

.ai-learning-empty strong {
    margin-bottom: 10px;

    color: #3d5046;

    font-size: 15px;
    font-weight: 800;
}

.ai-learning-empty p {
    margin: 0;

    color: #8a9790;

    font-size: 13px;
    line-height: 1.7;
}


/* =========================================================
   수정 / 학습 승인 버튼
   ========================================================= */

/* AI 분석 결과 수정 중 */
#aiRealAnswer.editing {
    outline: 1px solid #9fb8aa;
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
    cursor: text;
}





.ai-learning-result-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;

    margin-top: 16px;
}

.ai-learning-edit-btn,
.ai-learning-approve-btn {
    height: 38px;

    padding: 0 18px;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 800;

    cursor: pointer;
}

.ai-learning-edit-btn {
    border: 1px solid #ccd8d1;

    background: #ffffff;
    color: #5f7067;
}

.ai-learning-edit-btn:hover {
    background: #f3f7f4;
}

.ai-learning-approve-btn {
    border: none;

    background: #3f6652;
    color: #ffffff;
}

.ai-learning-approve-btn:hover {
    background: #345846;
}


/* =========================================================
   iPad 가로 및 작은 PC 화면
   ========================================================= */

@media (max-width: 1180px) {

    .freshvault-ai-page {
        padding: 14px 16px 24px;
    }

    .ai-learning-workspace {
        gap: 14px;
    }

    .ai-learning-panel {
        padding: 18px;
    }

    .ai-learning-tab {
        min-width: 96px;
        padding: 0 12px;
    }
}


/* 화면이 더 좁아지면 세로 배치 */
@media (max-width: 900px) {

    .ai-learning-workspace {
        grid-template-columns: 1fr;
    }

    .ai-learning-panel {
        min-height: auto;
    }

    .ai-learning-tabs {
        overflow-x: auto;
    }

    .ai-learning-tab {
        flex: 0 0 auto;
    }
}



/* FreshVault AI 독립 페이지 레이아웃 */
body .layout {
    display: flex;
    width: 100%;
    height: 100vh;
}




/* =========================================================
   FreshVault AI 질문 / 답변 글자 가독성
   ========================================================= */

/* 사용자가 입력하는 질문 */
.ai-learning-textarea {
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #26352d;
    line-height: 1.75;
}


/* AI 실제 답변 */
#aiRealAnswer {
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #26352d;
    line-height: 1.8;
}

/* =========================================================
   FreshVault AI 분석 중 애니메이션
   ========================================================= */

.ai-learning-empty-icon {
    position: relative;
}

/* AI 원 바깥쪽 회전 링 */
.ai-learning-empty-icon.analyzing::after {
    content: "";

    position: absolute;
    inset: -7px;

    border: 3px solid #dce9e1;
    border-top-color: #3f6652;

    border-radius: 50%;

    animation: freshvaultAiSpin 0.9s linear infinite;
}

@keyframes freshvaultAiSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}



/* =========================================================================================
   FreshVault AI - 테스트 결과 답변 글씨
   학습 입력 > AI 해석 결과와 동일한 크기/굵기
   ========================================================================================= */

#aiTestRealAnswer {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-break: keep-all;
}

#aiTabTest .ai-analysis-block > span {
    font-size: 14px;
    font-weight: 700;
    color: #555;
}

#aiTestRealAnswer {
    text-align: left;
    width: 100%;
    max-width: 100%;
}



#aiTabTest .ai-analysis-block {
    text-align: left;
    width: 100%;
}





/* =========================================================
   FreshVault AI - 검토 대기
   ========================================================= */

.ai-review-page {
    width: 100%;
    padding: 4px 2px 20px;
    box-sizing: border-box;
}

.ai-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 20px;
    margin-bottom: 16px;

    background: #ffffff;
    border: 1px solid #dfe7e2;
    border-radius: 12px;
}

.ai-review-header h3 {
    margin: 0 0 5px;
    color: #263c31;
    font-size: 19px;
    font-weight: 800;
}

.ai-review-header span {
    color: #7a8981;
    font-size: 13px;
}

.ai-review-count {
    padding: 8px 14px;

    background: #eef4f0;
    border-radius: 20px;

    color: #53645b;
    font-size: 13px;
    font-weight: 700;
}

.ai-review-list {
    min-height: 420px;

    padding: 18px;

    background: #ffffff;
    border: 1px solid #dfe7e2;
    border-radius: 12px;

    box-sizing: border-box;
}

.ai-review-empty {
    min-height: 360px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #8a9790;
    font-size: 14px;
    font-weight: 500;
}







/* =========================================================================================
   FreshVault AI - 학습 지식 4분할 카드 화면
   ========================================================================================= */


/* 전체 2 × 2 그리드 */
#aiKnowledgeList .ai-knowledge-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}


/* 업무 지식 / 용어 / 규칙 / 문서 큰 카드 */
#aiKnowledgeList .ai-knowledge-group {
    background: #ffffff;
    border: 1px solid #e4e9e5;
    border-radius: 14px;
    overflow: hidden;
    min-height: 260px;
    box-sizing: border-box;
}


/* 큰 카드 상단 */
#aiKnowledgeList .ai-knowledge-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 18px 20px;

    background:  #e6efe9;
    border-bottom: 1px solid #e6ebe7;
}


#aiKnowledgeList .ai-knowledge-group-header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


#aiKnowledgeList .ai-knowledge-group-header strong {
    font-size: 16px;
    font-weight: 700;
    color: #2f3b34;
}


#aiKnowledgeList .ai-knowledge-group-header span {
    font-size: 12px;
    font-weight: 400;
    color: #7a837d;
}


/* 등록 개수 */
#aiKnowledgeList .ai-knowledge-group-count {
    min-width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 17px;

    background: #e4ece7;

    font-size: 13px;
    font-weight: 700;
    color: #355848;
}


/* 큰 카드 내부 */
#aiKnowledgeList .ai-knowledge-group-body {
    padding: 14px;
}


/* 개별 학습 지식 카드 */
#aiKnowledgeList .ai-knowledge-item {
    background: #fbfcfb;
    border: 1px solid #e8ece9;
    border-radius: 10px;

    padding: 14px 16px;
    margin-bottom: 10px;

    transition: 0.15s ease;
}


#aiKnowledgeList .ai-knowledge-item:last-child {
    margin-bottom: 0;
}


#aiKnowledgeList .ai-knowledge-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.05);
}


/* 실제 지식 내용 */
#aiKnowledgeList .ai-knowledge-item-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.65;

    color: #343a36;

    word-break: keep-all;
}


/* 최종 승인 날짜 */
#aiKnowledgeList .ai-knowledge-item-date {
    margin-top: 10px;

    font-size: 11px;
    font-weight: 400;

    color: #909792;
}


/* 해당 종류에 아직 데이터가 없을 때 */
#aiKnowledgeList .ai-knowledge-group-empty {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 130px;

    font-size: 13px;
    color: #a0a7a2;
}


/* iPad 가로 / 작은 화면 */
@media (max-width: 1050px) {

    #aiKnowledgeList .ai-knowledge-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================================================
   FreshVault AI - 학습 지식 카드 내부 스크롤
   - 큰 카드 높이는 유지
   - 지식 목록만 세로 스크롤
   ========================================================================================= */

#aiKnowledgeList .ai-knowledge-group {
    height: 330px;
    display: flex;
    flex-direction: column;
}


/* 상단 제목 영역은 고정 */
#aiKnowledgeList .ai-knowledge-group-header {
    flex-shrink: 0;
}


/* 지식 목록 영역만 스크롤 */
#aiKnowledgeList .ai-knowledge-group-body {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 14px;
}


/* 스크롤바 너무 두껍지 않게 */
#aiKnowledgeList .ai-knowledge-group-body::-webkit-scrollbar {
    width: 7px;
}

#aiKnowledgeList .ai-knowledge-group-body::-webkit-scrollbar-track {
    background: transparent;
}

#aiKnowledgeList .ai-knowledge-group-body::-webkit-scrollbar-thumb {
    background: #d5ddd8;
    border-radius: 10px;
}

#aiKnowledgeList .ai-knowledge-group-body::-webkit-scrollbar-thumb:hover {
    background: #bcc9c1;
}







/* =========================================================================================
   FreshVault AI - 학습 지식 편집 / 선택 / 삭제
   ========================================================================================= */


/* 등록 건수 + 편집 + 삭제 */
.ai-knowledge-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


/* 편집 버튼 */
.ai-knowledge-edit-btn {
    height: 32px;
    padding: 0 13px;

    border: 1px solid #cfdad3;
    border-radius: 7px;

    background: #ffffff;

    font-size: 12px;
    font-weight: 600;

    color: #425249;

    cursor: pointer;
}


/* 삭제 버튼 */
.ai-knowledge-delete-btn {
    height: 32px;
    padding: 0 13px;

    border: 1px solid #e1caca;
    border-radius: 7px;

    background: #ffffff;

    font-size: 12px;
    font-weight: 600;

    color: #9a4c4c;

    cursor: pointer;
}


/* 삭제 불가능 상태 */
.ai-knowledge-delete-btn:disabled {
    opacity: 0.35;
    cursor: default;
}


/* 편집 중 개별 지식 카드 */
.ai-knowledge-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}


/* 지식 본문 */
.ai-knowledge-item-content {
    flex: 1;
    min-width: 0;
}


/* 선택 동그라미 */
.ai-knowledge-select-circle {
    width: 18px;
    height: 18px;

    flex: 0 0 18px;

    margin-top: 2px;

    padding: 0;

    border: 1.5px solid #aab9b0;
    border-radius: 50%;

    background: #ffffff;

    cursor: pointer;

    box-sizing: border-box;
}


/* 선택된 동그라미 */
.ai-knowledge-select-circle.selected {
    border: 5px solid #557763;
}


/* 선택된 지식 카드 */
.ai-knowledge-item.selected {
    background: #f2f7f4;
    border-color: #c8d9cf;
}


/* =========================================================
   FreshVault AI - 공통 상세보기 버튼
========================================================= */
.ai-detail-view-btn {
    width: auto;
    min-width: 108px;

    padding: 0 14px;

    white-space: nowrap;
}

/* =========================================================
   FreshVault AI - 재고 조회 답변 가독성
========================================================= */
.ai-analysis-block p {
    color: #2f3d36;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
}


.ai-analysis-block p strong {
    color: #1f3328;
    font-weight: 700;
}



/* FreshVault AI 지역 지점 상세보기 버튼 */
.ai-region-detail-btn {
    width: auto;
    min-width: 140px;
    height: 34px;
    margin-top: 16px;
    padding: 0 16px;

    background: #315b46;
    border-color: #315b46;
    color: #ffffff;
}




/* FreshVault AI 채팅창 이동 영역 */
.fv-ai-header {
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.fv-ai-header button {
    cursor: pointer;
}



/* =========================================================
   FreshVault AI 간단 안내 메시지
   - 대화가 끊기지 않도록 납작하게 표시
========================================================= */
.ai-learning-empty.ai-chat-compact {
    width: auto;
    min-height: 0 !important;
    height: auto !important;

    margin: 6px 0;
    padding: 11px 14px !important;

    display: block;
    box-sizing: border-box;

    border: 1px solid #dce8e2;
    border-radius: 10px;

    background: #f7faf8;

    text-align: left;
}


.ai-learning-empty.ai-chat-compact strong {
    display: block;

    margin: 0 0 4px;

    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;

    color:  #1f3328;
}


.ai-learning-empty.ai-chat-compact p {
    margin: 0;

    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;

    color: #68756f;
}




/* 모든 AI 답변의 공통 박스 */
.fv-ai-answer-card {
    padding: 14px 16px;
    border: none;
    border-radius: 8px;
    background: #f7faf8;
    box-sizing: border-box;
}

/* AI 공통 답변 글씨 */
.fv-ai-answer-card,
.fv-ai-answer-card p,
.fv-ai-answer-card strong {
    font-family: Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.55;
    color: #68756f;
    text-align: left;
}

.fv-ai-answer-card p {
    margin: 0;
}


