/* 프로젝트 관리 페이지 스타일 */

.project-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.project-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}


/* 태블릿 및 모바일 반응형 */
@media (max-width: 992px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    position: relative;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.project-card-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.project-card-body {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.project-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: #007bff;
    display: block;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.version-list {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.version-item {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 0.5rem;
    border: 1px solid #f1f3f4;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.version-item.active {
    background: #e3f2fd;
    border-color: #2196f3;
}

.version-name {
    font-weight: 500;
    flex: 1;
}

.version-date {
    color: #6c757d;
    font-size: 0.75rem;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.language-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.language-arrow {
    color: #007bff;
    font-weight: bold;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.project-form-modal .modal-dialog {
    max-width: 600px;
}

.analysis-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-none {
    background: #f8f9fa;
    color: #6c757d;
}

.quick-actions {
    margin-top: 2rem;
    /* 2026-05-07: 하단 프로젝트 카드 컨테이너와의 간격 추가 (옛 0 → 1.5rem) */
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.action-card:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.action-icon {
    font-size: 2rem;
    color: #007bff;
    margin-bottom: 0.5rem;
}

/* RAG 클릭 가능한 통계 스타일 */
.rag-stat-clickable {
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    padding: 0.25rem;
}

.rag-stat-clickable:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.rag-stat-clickable:hover .stat-number {
    color: #0056b3 !important;
    font-weight: 700;
}

.rag-stat-clickable:hover .stat-label {
    color: #495057 !important;
    font-weight: 600;
}

/* 파일 통계 클릭 가능한 스타일 */
.files-stat-clickable {
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    padding: 0.25rem;
}

.files-stat-clickable:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.files-stat-clickable:hover .stat-number {
    color: #2e7d32 !important;
    font-weight: 700;
}

.files-stat-clickable:hover .stat-label {
    color: #495057 !important;
    font-weight: 600;
}

/* 파일 업로드 영역 — 2026-05-07: 파일 버튼 톤앤매너 (mint) 통일 */
.upload-area {
    border: 2px dashed #56c596;
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.upload-area:hover {
    border-color: #2ea476;
    background-color: #f0fbf6;
    box-shadow: 0 2px 8px rgba(86, 197, 150, 0.18);
}

.upload-area.drag-over {
    border-color: #2ea476;
    background-color: #d1f2eb;
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(86, 197, 150, 0.3);
}

.upload-area i {
    font-size: 3rem;
    color: #2ea476;
    display: block;
    margin-bottom: 1rem;
}

.upload-area p {
    margin: 0;
    font-weight: 600;
    color: #0d4f3c;
}

.upload-area small {
    display: block;
    margin-top: 0.5rem;
    color: #2ea476;
}

/* 파일 목록 섹션 */
.file-list-section {
    margin-top: 2rem;
}

.file-list-section table {
    font-size: 0.875rem;
    background: transparent !important;
}

.file-list-section table tbody tr {
    background: white !important;
}

.file-list-section table tbody tr td {
    background-color: transparent !important;
}

.file-list-section .btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* 업로드 진행률 */
.upload-progress {
    margin-top: 1rem;
}

.upload-progress .progress {
    height: 25px;
}

.upload-progress .progress-bar {
    font-weight: 500;
}

/* 진행 상태 모달 스타일 */
.progress-info {
    padding: 1rem;
}

.tm-statistics {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.tm-statistics h6 {
    margin-bottom: 1rem;
    color: #495057;
    font-weight: 600;
}

.tm-statistics .fs-4 {
    font-weight: 600;
}

.tm-statistics small {
    color: #6c757d;
    display: block;
    margin-top: 0.25rem;
}

/* 파일 패널 - 전체 너비 확장 방식 */

/* 파일 패널 컨테이너 (전체 너빔) — 2026-05-07: 파일 버튼 톤앤매너 통일 (mint) */
.file-panel {
    display: none;
    grid-column: 1 / -1;  /* 전체 그리드 너비 차지 */
    padding: 1.5rem;
    background: linear-gradient(135deg, #f0fbf6 0%, #e6f8ee 100%);
    border: 1.5px solid #56c596;
    border-radius: 10px;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(86, 197, 150, 0.12);
    animation: slideDown 0.3s ease-out;
}

.file-panel.show {
    display: grid;
    grid-template-columns: 1fr 2fr;  /* 업로드 영역 | 파일 목록 */
    gap: 1.5rem;
}


/* 모바일에서는 세로 정렬 */
@media (max-width: 768px) {
    .file-panel.show {
        grid-template-columns: 1fr;
    }
}

/* 파일 통계 클릭 가능 스타일 */
.files-stat-expandable {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.files-stat-expandable:hover {
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.files-stat-expandable:hover .stat-number {
    color: #2e7d32 !important;
    font-weight: 700;
}

.files-stat-expandable .stat-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* 화살표 회전 애니메이션 */
.files-stat-expandable .chevron-icon {
    transition: transform 0.3s ease;
    font-size: 0.75rem;
}

.files-stat-expandable.expanded .chevron-icon {
    transform: rotate(180deg);
}

/* 파일 패널 내부 업로드 영역 재활용 */
.file-panel .upload-area {
    min-height: 120px;  /* 카드 내에서는 높이 축소 */
    padding: 1.5rem;
}

.file-panel .file-list-section {
    max-height: 400px;
    overflow-y: auto;
}

/* 슬라이드 다운 애니메이션 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 파일 패널 헤더 — 2026-05-07: 파일 버튼 톤앤매너 (mint) 통일 */
.file-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1.5px solid #b8e6d8;
    margin-bottom: 1rem;
}

.file-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0d4f3c;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-panel-title i {
    color: #2ea476;
    font-size: 1.2rem;
}

/* 파일 패널 닫기 버튼 — mint hover */
.file-panel-header .btn-outline-secondary {
    border-color: #b8e6d8;
    color: #2ea476;
    transition: all 0.15s ease;
}

.file-panel-header .btn-outline-secondary:hover {
    background-color: #d1f2eb;
    border-color: #56c596;
    color: #0d4f3c;
}

/* 파일 목록 영역 — "업로드된 파일" 섹션 헤더 */
.file-panel .file-list-section h6 {
    color: #0d4f3c;
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #d1f2eb;
}

/* 파일 없음 빈 상태 텍스트 */
.file-panel .file-list .text-muted {
    color: #2ea476 !important;
}

/* ── 2026-05-07: 파일 목록 테이블 mint 톤앤매너 통일 ── */
.file-panel .file-list {
    background: #ffffff;
    border: 1px solid #d1f2eb;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(13, 79, 60, 0.06);
}

/* 테이블 자체 — Bootstrap default 무력화 */
.file-panel .file-list-section table.table {
    margin-bottom: 0 !important;
    background: transparent !important;
    border-collapse: separate;
    border-spacing: 0;
}

/* 헤더 — mint 배경 */
.file-panel .file-list-section table.table thead tr {
    background: linear-gradient(135deg, #e6f8ee 0%, #d1f2eb 100%);
}

.file-panel .file-list-section table.table thead th {
    background: transparent !important;
    color: #0d4f3c;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: none;
    letter-spacing: 0.02em;
    padding: 0.65rem 0.85rem;
    border-bottom: 1.5px solid #b8e6d8 !important;
    border-top: none !important;
}

/* 본문 row — 흰 배경, mint 구분선, hover 시 mint tint */
.file-panel .file-list-section table.table tbody tr {
    background: #ffffff !important;
    transition: background-color 0.12s ease;
}

.file-panel .file-list-section table.table tbody tr:hover {
    background: #f0fbf6 !important;
}

.file-panel .file-list-section table.table tbody td {
    background-color: transparent !important;
    padding: 0.7rem 0.85rem;
    vertical-align: middle;
    border-top: 1px solid #e6f8ee !important;
    color: #1f3a30;
}

.file-panel .file-list-section table.table tbody tr:first-child td {
    border-top: none !important;
}

/* Excel 아이콘 — mint 톤 */
.file-panel .file-list-section table.table tbody td .bi-file-earmark-excel {
    color: #2ea476 !important;
    font-size: 1.05rem;
}

/* 파일명 + 보조명 */
.file-panel .file-list-section table.table tbody td .fw-medium {
    color: #0d4f3c;
    font-weight: 600;
}

.file-panel .file-list-section table.table tbody td small.text-muted {
    color: #56c596 !important;
    font-size: 0.72rem;
}

/* 작업 버튼 그룹 — mint 톤 override */
.file-panel .file-list-section .btn-group-sm .btn {
    padding: 0.32rem 0.55rem;
    font-size: 0.78rem;
    border-radius: 6px !important;
    border-width: 1.5px;
    transition: all 0.15s ease;
}

/* 시트 보기 (info → mint primary) */
.file-panel .file-list-section .btn-outline-info {
    color: #2ea476 !important;
    border-color: #b8e6d8 !important;
    background: #ffffff !important;
}
.file-panel .file-list-section .btn-outline-info:hover {
    background: #d1f2eb !important;
    border-color: #56c596 !important;
    color: #0d4f3c !important;
}

/* 워크스페이스 열기 (primary → mint accent) */
.file-panel .file-list-section .btn-outline-primary {
    color: #ffffff !important;
    background: linear-gradient(135deg, #56c596 0%, #2ea476 100%) !important;
    border-color: #2ea476 !important;
}
.file-panel .file-list-section .btn-outline-primary:hover {
    background: linear-gradient(135deg, #2ea476 0%, #1f7d5a 100%) !important;
    border-color: #1f7d5a !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(46, 164, 118, 0.3);
}

/* 삭제 (danger 유지하되 mint 카드와 조화 — soft red) */
.file-panel .file-list-section .btn-outline-danger {
    color: #c0392b !important;
    border-color: #f5c6cb !important;
    background: #ffffff !important;
}
.file-panel .file-list-section .btn-outline-danger:hover {
    background: #fdecea !important;
    border-color: #e74c3c !important;
    color: #a52a1f !important;
}

/* btn-group 사이의 검은 border 무력화 */
.file-panel .file-list-section .btn-group-sm > .btn + .btn {
    margin-left: 4px;
}
.file-panel .file-list-section .btn-group-sm > .btn {
    border-radius: 6px !important;
}

/* ========================================
   🔧 FIX 14.4: File Progress Display Styles
   ======================================== */

/* 파일 진행률 표시 행 (inline progress row) */
.file-progress-row {
    background-color: #f8f9fa;
    border-top: none !important;
    animation: slideDown 0.3s ease-out;
    transition: all 0.3s ease;
}

.file-progress-row td {
    padding: 0.75rem 1rem !important;
    border-top: 1px dashed #dee2e6 !important;
}

/* 진행률 컨테이너 */
.sheet-progress-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* WebSocket 상태 배지 */
.sheet-progress-container .ws-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 파일 이름 강조 */
.processing-file-name {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
}

/* 진행률 바 커스텀 */
.sheet-progress-container .progress {
    background-color: #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    /* 🔧 FIX 14.7: flex-grow-1 지원을 위한 최소 너비 */
    min-width: 0;
}

.sheet-progress-container .progress-bar {
    transition: width 0.4s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.progress-percentage {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

/* 🔧 FIX 14.7: 진행 상세 정보 컨테이너 (파일 이름 포함) */
/* 🔧 FIX 16.1: 두 줄 간 시각적 구분 강화 */
.progress-details {
    margin-top: 0;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* 진행률 텍스트 */
.progress-text {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

/* 시트별 상세 진행 정보 */
.sheet-progress-details {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
    border-left: 3px solid #007bff;
}

.sheet-progress-details:empty {
    display: none;
}

.sheet-progress-details .badge {
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

/* 완료 상태 스타일 */
.sheet-progress-container.completed .progress-bar {
    background-color: #28a745 !important;
}

.sheet-progress-container.completed .ws-status {
    background-color: #28a745 !important;
    animation: none;
}

.sheet-progress-container.completed .spinner-border {
    display: none;
}

/* 에러 상태 스타일 */
.sheet-progress-container.error .progress-bar {
    background-color: #dc3545 !important;
}

.sheet-progress-container.error .ws-status {
    background-color: #dc3545 !important;
}

.sheet-progress-container.error .progress-text {
    color: #dc3545;
    font-weight: 600;
}

/* 스피너 애니메이션 */
.sheet-progress-container .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

/* 페이즈별 강조 색상 */
.sheet-progress-details[data-phase="reading"] {
    border-left-color: #17a2b8;
}

.sheet-progress-details[data-phase="analyzing"] {
    border-left-color: #ffc107;
}

.sheet-progress-details[data-phase="completed"] {
    border-left-color: #28a745;
}

.sheet-progress-details[data-phase="error"] {
    border-left-color: #dc3545;
    background: #fff5f5;
}

/* 반응형: 모바일에서 간소화 */
@media (max-width: 768px) {
    .sheet-progress-container {
        padding: 0.75rem;
    }

    .processing-file-name {
        font-size: 0.85rem;
    }

    .sheet-progress-details {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .ws-status {
        font-size: 0.7rem !important;
    }
}

/* 진행률 행 페이드 아웃 효과 (자동 숨김 시) */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}

.file-progress-row.hiding {
    animation: fadeOut 0.3s ease-out forwards;
}

/* 호버 효과 */
.file-progress-row:hover {
    background-color: #e9ecef;
}

.sheet-progress-container:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}
/* ─────────────────────────────────────────────────────────
   2026-05-07 (v2): Project card action 재구성.
   - 파일 = full-width prominent bar (가장 중요한 액션 — mint 강조)
   - 작업시작 / 버전 / RAG = 1×3 동일계층 grid (같은 스타일)
   - "분석" 제거 (백엔드 endpoint 부재)
   ───────────────────────────────────────────────────────── */

/* ─── 파일 bar — 가로로 긴 prominent 박스 (가장 중요한 액션) ─── */
.pa-file-bar {
    /* P-X fix (2026-05-07): full-width 강제 (다중 안전망) */
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 100%;                 /* flex container ancestor 안에서도 강제 stretch */
    box-sizing: border-box;          /* padding 포함 100% — 부모 가득 채움 */
    align-self: stretch;             /* parent 가 flex 면 cross-axis 도 stretch */
    -webkit-appearance: none;        /* <button> UA default reset (Safari/Chrome) */
    -moz-appearance: none;           /* Firefox UA reset */
    appearance: none;
    font-family: inherit;            /* <button> UA font 도 reset */
    font-size: inherit;
    /* 시각 디자인 — main.css 의 generic `button { background-color: #007bff }`
       를 완전히 덮기 위해 background-color 도 명시 (shorthand + longhand 양쪽 보강) */
    padding: 14px 18px;
    border: 1.5px solid #56c596;
    border-radius: 10px;
    background-color: transparent;
    background: linear-gradient(135deg, #d1f2eb 0%, #b8e6d8 100%);
    color: #0d4f3c;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(86, 197, 150, 0.15);
    position: relative;
}

.pa-file-bar:hover {
    /* main.css:234 의 generic `button:hover { background-color: #0056b3 }` 를
       완전히 덮기 위해 background-color 도 명시 (shorthand + longhand 양쪽 보강) */
    background-color: transparent;
    background: linear-gradient(135deg, #b8e6d8 0%, #99d9c4 100%);
    border-color: #2ea476;
    box-shadow: 0 4px 14px rgba(86, 197, 150, 0.32);
    transform: translateY(-1px);
    /* color 자체는 그대로 — 가독성 유지 */
    color: #0a3d2e;
}

/* hover 시 inner text/icon 명시 — inherit chain 보강 */
.pa-file-bar:hover .pa-file-bar-icon,
.pa-file-bar:hover .pa-file-bar-label,
.pa-file-bar:hover .pa-file-bar-chevron {
    color: #0a3d2e;
}
.pa-file-bar:hover .pa-file-bar-sub {
    color: #1f7d5a;                  /* sub-text 도 hover bg 와 contrast 충분히 */
}

.pa-file-bar:focus-visible {
    outline: 2px solid #2ea476;
    outline-offset: 2px;
}

.pa-file-bar:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(86, 197, 150, 0.2);
}

.pa-file-bar-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    color: #0d4f3c;
}

.pa-file-bar-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.pa-file-bar-label {
    font-weight: 700;
    font-size: 16px;
    color: #0d4f3c;
    line-height: 1.2;
}

.pa-file-bar-sub {
    font-size: 12px;
    color: #2ea476;
    margin-top: 2px;
}

.pa-file-bar-count {
    background: #2ea476;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 14px;
    min-width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.pa-file-bar-chevron {
    font-size: 14px;
    color: #0d4f3c;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 4px;
}

.files-stat-expandable[data-expanded="true"] .pa-file-bar-chevron {
    transform: rotate(180deg);
}

/* ─── 1×N grid — 동일계층 + 동일 스타일.
       기본 3 column (legacy), .project-action-grid-4 으로 4 column.
       2026-05-07: 버전 → TM/용어집 으로 교체되어 4 버튼 (작업시작 / TM / 용어집 / RAG). ─── */
.project-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.project-action-grid.project-action-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.pa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    /* main.css generic button override 강화 */
    background-color: #ffffff;
    background: #ffffff;
    color: #495057;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    text-align: center;
    min-height: 76px;
    position: relative;
    font-size: 13px;
    box-sizing: border-box;
}

.pa-btn:hover {
    background-color: #f8f9fa;
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.pa-btn:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.pa-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.pa-icon {
    font-size: 18px;
    line-height: 1;
    color: #495057;
}

.pa-label {
    font-weight: 600;
    font-size: 12px;
    color: #212529;
    line-height: 1.2;
}

.pa-badge {
    /* count 표시 — 우측 상단 작은 원형 */
    position: absolute;
    top: 6px;
    right: 6px;
    background: #e9ecef;
    color: #495057;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.4;
}

/* ─── Responsive — 좁은 화면에서 padding 압축 ─── */
@media (max-width: 480px) {
    /* 4 column grid 는 좁아지면 2×2 으로 wrap */
    .project-action-grid.project-action-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 360px) {
    .pa-file-bar {
        padding: 12px 14px;
        gap: 10px;
    }
    .pa-file-bar-icon { font-size: 20px; }
    .pa-file-bar-label { font-size: 14px; }
    .pa-btn { padding: 10px 6px; min-height: 64px; }
}

/* 4 버튼 mode 에서 label 살짝 압축 (좁은 폭 대응) */
.project-action-grid.project-action-grid-4 .pa-btn {
    padding: 11px 4px;
    min-height: 72px;
}
.project-action-grid.project-action-grid-4 .pa-label {
    font-size: 11.5px;
}
.project-action-grid.project-action-grid-4 .pa-icon {
    font-size: 17px;
}
