/* 기본 버튼 – 관리자 UI와 호환되면서도 더 깔끔하게 */
.safex-btn {
    display: inline-flex;
    padding: 7px 14px;
    background: #0073aa;
    color: #fff !important;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s;
    align-items: center;
    gap:5px;
}

.safex-btn img,
.safex-btn svg {
    display: block;        /* 아이콘 아래 여백 제거 */
}

.safex-btn:hover {
    background: #005f8d;
}

/* 작은 버튼 */
.safex-btn.sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* 녹색 버튼 */
.safex-btn.green {
    background: #46b450;
}

.safex-btn.green:hover {
    background: #37963f;
}

/* 빨간 버튼 */
.safex-btn.red {
    background: #dc3232;
}

.safex-btn.red:hover {
    background: #b92a2a;
}

/* 회색 버튼 */
.safex-btn.gray {
    background: #888;
}

.safex-btn.gray:hover {
    background: #666;
}

.safex-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-bottom: 25px;
    color: #555;
}

.safex-breadcrumb .item {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.safex-breadcrumb .item:hover {
    text-decoration: underline;
}

.safex-breadcrumb .divider {
    color: #999;
}

.safex-breadcrumb .item.current {
    color: #111;
    font-weight: 700;
    pointer-events: none;
}

/* Safex 메시지 공통 스타일 */
.safex-msg-box {
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 10px;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.5;
}

/* 진행중 */
.safex-msg-loading {
    background: #fff7e6;
    border: 1px solid #f0ad4e;
    color: #b06d00;
}

/* 성공 */
.safex-msg-success {
    background: #e7f7ed;
    border: 1px solid #46b678;
    color: #207a42;
}

/* 오류 */
.safex-msg-error {
    background: #fdeaea;
    border: 1px solid #d9534f;
    color: #b52b27;
}

.safex-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.safex-table-wrapper table {
    min-width: max-content;
    white-space: nowrap;
}

.safex-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
}

.safex-table th,
.safex-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e6e6e6;
    font-size: 14px;
}

.safex-table thead th {
    background: #f6f7f7;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

/* 홀수/짝수 줄 구분 */
.safex-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Hover */
.safex-table tbody tr:hover {
    background: #eef7ff;
}

/* 폭 좁은 열 */
.safex-w60 { width: 60px; }
.safex-w100 { width: 100px; }
.safex-w150 { width: 150px; }


.safex-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    display: inline-block;
}

/* 상태별 */
.safex-status.pending,
.safex-status.queued {
    background: #aaa; /* 대기 */
}

.safex-status.processing,
.safex-status.in_progress,
.safex-status.analyzing {
    background: #0073aa; /* 처리중 */
}

.safex-status.completed {
    background: #2ecc71; /* 완료 */
}

.safex-status.error,
.safex-status.failed {
    background: #e53935; /* 실패 */
}

.safex-status.review,
.safex-status.need_review {
    background: #f39c12; /* 검수대기 */
}

.safex-status.inspecting {
    background: #9b59b6; /* 검수중 */
}


.safex-row {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.safex-col {
    flex: 1;
}

/* REVIEW 페이지 전용 레이아웃 */
.safex-review-page .safex-row {
    display: flex;
    gap: 30px;
}

.safex-review-page .safex-col:first-child {
    flex: 0 0 35%;  /* 35% 고정 */
    min-width: 0;
}

.safex-review-page .safex-col:last-child {
    flex: 1;        /* 남은 공간 */
    min-width: 0;   /* flex overflow 방지 */
}

.safex-summary-row {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.safex-summary-box {
    padding: 25px;
    background: #f8fafc;
    border-left: 5px solid #0073aa;
    border-radius: 6px;
    width: 100%;
}

.safex-summary-title {
    font-size: 14px;
    color: #666;
}

.safex-summary-value {
    font-size: 32px;
    font-weight: 700;
    margin-top: 5px;
    color: #111;
}

.safex-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.safex-modal.show {
    display: flex;
}

.safex-modal-content {
    background: #fff;
    padding: 25px;
    width: 380px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* 요약 카드 4칸 레이아웃 */
.safex-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 20px 0 40px 0;
}

/* 요약 카드 박스 */
.safex-summary-card {
    background: #e7edfa;
    border-radius: 10px;
    padding: 22px 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.safex-summary-card h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #3859a7;
}

.safex-summary-card p {
    margin: 0;
    margin-top: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #111;
}

/* 보고서 박스 */
.safex-report-box {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e2e2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* 보고서 텍스트 글꼴 */
.safex-report-box pre {
    font-size: 15px !important;
    font-family: Consolas, "Courier New", monospace;
    color: #222;
    line-height: 1.6;
    background: #f8f8f8;
    padding: 18px;
    border-radius: 6px;
    border: 1px solid #ddd;
    overflow-x: auto;
}

/* 반응형 */
@media (max-width: 980px) {
    .safex-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .safex-summary-grid {
        grid-template-columns: 1fr;
    }
}