/* ===== Scroll Navigation (맨 위/맨 아래 이동) ===== */
.scroll-nav {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.scroll-nav.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-ash, #ddd);
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--color-slate, #555);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.scroll-nav-btn:hover {
    background-color: var(--color-lg-red, #a50034);
    color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(165, 0, 52, 0.3);
}

.scroll-nav-btn:active {
    transform: scale(0.95);
}

.scroll-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== Section (Toggle) ===== */
.section {
    margin-bottom: -4px;
    padding-bottom: 0;
}

.section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    padding: var(--spacing-8) var(--spacing-12);
    background-color: var(--color-paper-mist);
    border: none;
    border-radius: var(--radius-cards);
    transition: background-color 0.2s ease;
}

.section-header:hover {
    background-color: #ececec;
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-8);
}

.section-header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-16);
    flex-wrap: wrap;
}

.section-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--color-charcoal);
}

.section-sub {
    font-size: 13px;
    color: var(--color-fog);
}

.section-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--color-canvas-white);
    border: 1px solid var(--color-ash);
    color: var(--color-steel);
    font-size: 12px;
    transition: transform 0.3s ease;
}

.section.collapsed .section-toggle-icon {
    transform: rotate(-90deg);
}

.section-content {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 5000px;
    opacity: 1;
}

.section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    margin: 0;
}


/* ===== Table ===== */
.table-container {
    background-color: var(--color-canvas-white);
    border: 1px solid var(--color-ash);
    border-radius: var(--radius-cards);
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background-color: var(--color-paper-mist);
    color: var(--color-steel);
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    padding: var(--spacing-12) var(--spacing-16);
    border-bottom: 1px solid var(--color-ash);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody td {
    padding: var(--spacing-12) var(--spacing-16);
    border-bottom: 1px solid var(--color-ash);
    vertical-align: middle;
}

/* 프로젝트/과제 관리 테이블 행 높이 여백 최적화 (행 간격 컴팩트화) */
.project-management-table thead th {
    padding: 6px 4px;
    font-size: 11.5px;
}

.project-management-table tbody td {
    padding: 3px 8px;
    line-height: 1.2;
    font-size: 12.5px;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: var(--color-paper-mist);
}

.project-key {
    font-weight: 600;
    color: var(--color-lg-red);
    font-size: 12px;
    white-space: nowrap;
}

.project-key a {
    color: var(--color-lg-red);
    text-decoration: none;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.project-key a:hover {
    color: var(--color-lg-red-dark);
    text-decoration: underline;
}

.project-name {
    color: var(--color-charcoal);
    font-weight: 500;
    white-space: nowrap;
}

.project-total {
    font-weight: 600;
    color: var(--color-charcoal);
    text-align: center;
}

.project-total a {
    color: var(--color-lg-red);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.project-total a:hover {
    color: var(--color-lg-red-dark);
    text-decoration: underline;
}

.project-total.zero {
    color: var(--color-silver);
    font-weight: 400;
}

/* ===== 재발율 셀 스타일 ===== */
.project-recurrence-rate {
    font-weight: 600;
    color: var(--color-charcoal);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.project-recurrence-rate .recurrence-cell-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
}

.project-recurrence-rate.zero {
    color: var(--color-silver, #94a3b8);
    font-weight: 400;
}

.project-recurrence-rate.zero .recurrence-rate-val {
    color: var(--color-silver, #94a3b8);
    font-weight: 500;
}

.project-recurrence-rate .recurrence-rate-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-charcoal, #1e293b);
    line-height: 1.05;
}

.project-recurrence-rate .recurrence-count-sub {
    font-size: 10px;
    font-weight: 500;
    color: var(--color-fog, #64748b);
    line-height: 1.05;
    margin-top: 1px;
}

.project-recurrence-rate.zero .recurrence-count-sub {
    color: var(--color-silver, #94a3b8);
    font-weight: 400;
}

.project-recurrence-rate.has-recurrence a.epic-recurrence-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
    text-decoration: none;
    background: none;
    padding: 0;
    border-radius: 0;
    cursor: pointer;
}

.project-recurrence-rate.has-recurrence a.epic-recurrence-link .recurrence-rate-val {
    color: var(--color-lg-red, #a50034);
    font-weight: 700;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.project-recurrence-rate.has-recurrence a.epic-recurrence-link .recurrence-count-sub {
    color: var(--color-fog, #64748b);
    transition: color 0.15s ease;
}

.project-recurrence-rate.has-recurrence a.epic-recurrence-link:hover .recurrence-rate-val {
    color: var(--color-lg-red-dark, #800028);
    text-decoration: underline;
}

.project-recurrence-rate.has-recurrence a.epic-recurrence-link:hover .recurrence-count-sub {
    color: var(--color-lg-red, #a50034);
}

.project-recurrence-rate.has-recurrence .recurrence-count-sub {
    color: var(--color-lg-red, #a50034);
    font-weight: 600;
    opacity: 0.85;
}

.project-type-count {
    text-align: center;
    font-weight: 500;
    color: var(--color-charcoal);
    white-space: nowrap;
}

.project-type-count a {
    color: var(--color-lg-red);
    text-decoration: none;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.project-type-count a:hover {
    color: var(--color-lg-red-dark);
    text-decoration: underline;
}

.project-type-count.zero {
    color: var(--color-silver);
    font-weight: 400;
}

.type-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-4);
}

.type-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-tags);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.type-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.type-tag .count {
    font-weight: 600;
}

/* Type colors - 브랜드 컬러 계열 */
.type-customer-audit { background-color: var(--color-lg-orange-bg); color: var(--color-lg-orange); }
.type-s-apqp { background-color: var(--color-lg-blue-bg); color: var(--color-lg-blue); }
.type-internal-audit { background-color: var(--color-lg-red-bg); color: var(--color-lg-red); }
.type-csr { background-color: var(--color-lg-purple-bg); color: var(--color-lg-purple); }
.type-lge { background-color: var(--color-lg-green-bg); color: var(--color-lg-green); }
.type-others { background-color: var(--color-lg-gray-100); color: var(--color-lg-gray-600); }
.type-vda { background-color: var(--color-lg-purple-bg); color: var(--color-lg-purple); }
.type-default { background-color: var(--color-lg-gray-100); color: var(--color-lg-gray-600); }

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: var(--spacing-24);
    color: var(--color-silver);
    font-size: 13px;
}
/* ===== AI Analysis ===== */
.ai-analysis-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-4);
}

/* 언어 전환 버튼 - 세그먼트 컨트롤 스타일 */
.lang-toggle {
    display: inline-flex;
    background-color: var(--color-paper-mist);
    border: 1px solid var(--color-ash);
    border-radius: var(--radius-tags);
    padding: 3px;
    gap: 2px;
    box-shadow: var(--shadow-subtle);
}

.lang-btn {
    background-color: transparent;
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    color: var(--color-fog);
    cursor: pointer;
    border-radius: var(--radius-tags);
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    letter-spacing: 0.02em;
}

.lang-btn:hover {
    color: var(--color-charcoal);
    background-color: rgba(255, 255, 255, 0.6);
}

.lang-btn.active {
    background-color: var(--color-canvas-white);
    color: var(--color-lg-red);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* 프로젝트 테이블 분석 리포트 셀 */
.project-report-cell {
    text-align: center;
    white-space: nowrap;
}

.project-report-cell a {
    color: var(--color-lg-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid var(--color-lg-red);
    border-radius: var(--radius-tags);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.project-report-cell a:hover {
    background-color: var(--color-lg-red);
    color: var(--color-canvas-white);
}

.project-report-cell.zero {
    color: var(--color-silver);
    font-weight: 400;
}

/* 리포트 카드 하이라이트 */
.ai-report-card.highlight {
    border-color: var(--color-lg-red);
    box-shadow: 0 0 0 3px rgba(165, 0, 52, 0.2);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.btn-analyze {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    box-sizing: border-box;
    background-color: #FFFFFF;
    color: #2D2D2D;
    border: 1px solid #D4D4D4;
    border-radius: 6px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

.btn-analyze:hover {
    background-color: #F5F5F5;
    border-color: #A3A3A3;
    color: #1A1A1A;
}

.btn-analyze:active {
    background-color: #E5E5E5;
    box-shadow: none;
}

.btn-analyze:disabled {
    background-color: var(--color-paper-mist, #f1f5f9);
    color: var(--color-silver, #94a3b8);
    border-color: var(--color-ash, #cbd5e1);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.8;
}

.btn-add-project {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    box-sizing: border-box;
    background-color: var(--color-lg-red, #a50034);
    color: #ffffff;
    border: 1px solid var(--color-lg-red, #a50034);
    border-radius: 6px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(165, 0, 52, 0.15);
    transition: all 0.15s ease;
}

.btn-add-project:hover {
    background-color: var(--color-lg-red-dark, #800028);
    border-color: var(--color-lg-red-dark, #800028);
}

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

.btn-add-project:disabled {
    background-color: var(--color-silver, #cbd5e1);
    border-color: var(--color-silver, #cbd5e1);
    color: #ffffff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-8);
    background-color: var(--color-canvas-white);
    color: var(--color-slate);
    border: 1px solid var(--color-ash);
    border-radius: var(--radius-buttons);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-subtle);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-refresh:hover {
    background-color: var(--color-paper-mist);
    color: var(--color-charcoal);
    border-color: var(--color-smoke);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.btn-refresh:disabled {
    background-color: var(--color-paper-mist);
    color: var(--color-silver);
    border-color: var(--color-ash);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.8;
}

.ai-analysis-status {
    font-size: 13px;
    color: var(--color-fog);
}

.ai-analysis-status.loading {
    color: var(--color-lg-red);
}

.ai-analysis-status.success {
    color: var(--color-lg-green);
}

.ai-analysis-status.error {
    color: var(--color-lg-red-dark);
}

.ai-analysis-results {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-16);
}

.ai-analysis-empty {
    text-align: center;
    padding: var(--spacing-32);
    color: var(--color-silver);
    font-size: 14px;
    background-color: var(--color-paper-mist);
    border-radius: var(--radius-cards);
    border: 1px dashed var(--color-ash);
}

.ai-analysis-loading {
    text-align: center;
    padding: var(--spacing-32);
    color: var(--color-lg-red);
    font-size: 14px;
    background-color: var(--color-paper-mist);
    border-radius: var(--radius-cards);
}

.ai-report-card {
    background-color: var(--color-canvas-white);
    border: 1px solid var(--color-ash);
    border-radius: var(--radius-cards);
    padding: var(--spacing-20);
    box-shadow: var(--shadow-subtle);
}

.ai-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-16);
    padding-bottom: var(--spacing-12);
    border-bottom: 1px solid var(--color-ash);
    flex-wrap: wrap;
    gap: var(--spacing-8);
}

.ai-report-project {
    display: flex;
    align-items: center;
    gap: var(--spacing-8);
}

.ai-report-key {
    font-weight: 700;
    color: var(--color-lg-red);
    font-size: 14px;
}

.ai-report-name {
    font-weight: 500;
    color: var(--color-charcoal);
    font-size: 14px;
}

.ai-report-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-12);
    font-size: 12px;
    color: var(--color-fog);
}

.ai-report-count {
    background-color: var(--color-lg-red-bg);
    color: var(--color-lg-red);
    padding: 2px 10px;
    border-radius: var(--radius-tags);
    font-weight: 600;
}

.ai-report-date {
    color: var(--color-silver);
}

.ai-report-summary,
.ai-report-risks,
.ai-report-recommendations {
    margin-bottom: var(--spacing-16);
}

.ai-report-summary h4,
.ai-report-risks h4,
.ai-report-recommendations h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-charcoal);
    margin-bottom: var(--spacing-8);
}

.ai-report-summary p {
    font-size: 13px;
    color: var(--color-slate);
    line-height: 1.7;
}

.ai-report-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.ai-report-list li {
    font-size: 13px;
    color: var(--color-slate);
    padding-left: var(--spacing-16);
    position: relative;
    line-height: 1.6;
}

.ai-report-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-lg-red);
    font-weight: 700;
}

.ai-report-risks .ai-report-list li::before {
    color: var(--color-lg-red);
}

.ai-report-recommendations .ai-report-list li::before {
    color: var(--color-lg-green);
}

.ai-report-none {
    font-size: 13px;
    color: var(--color-silver);
    font-style: italic;
}

/* ===== AI Report Modal ===== */
.report-modal-content {
    max-width: 900px;
}

.report-modal-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-12);
}

/* ===== 글로벌 알림 토스트 (SQM Toast Notification) ===== */
.sqm-toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 56px);
}

.sqm-toast {
    background: #1e293b;
    color: #f8fafc;
    padding: 13px 18px;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 1px 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    word-break: break-word;
    white-space: pre-line;
}

.sqm-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.sqm-toast .toast-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.sqm-toast .toast-msg {
    flex: 1;
}

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

.sqm-toast.error {
    border-left: 4px solid #ef4444;
}

.sqm-toast.warning {
    border-left: 4px solid #f59e0b;
}

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

