/* 실적 리스트 관련 스타일 */

/* Muted Gray 색상 변수 */
:root {
    --dapa-primary: #6b7280;        /* 중간 회색 */
    --dapa-primary-light: #9ca3af;  /* 밝은 회색 */
    --dapa-primary-dark: #4b5563;   /* 진한 회색 */
    --dapa-secondary: #6b7280;      /* 보조 회색 */
    --dapa-success: #6b7280;        /* 성공 (회색) */
    --dapa-warning: #78716c;        /* 경고 (따뜻한 회색) */
    --dapa-danger: #6b7280;         /* 오류 (회색) */
    --dapa-background: #f9fafb;     /* 매우 연한 회색 배경 */
    --dapa-surface: #ffffff;        /* 순백색 */
    --dapa-text-primary: #374151;   /* 다크 그레이 텍스트 */
    --dapa-text-secondary: #6b7280; /* 중간 회색 텍스트 */
    --dapa-border: #e5e7eb;         /* 연한 회색 보더 */
    --dapa-accent: #9ca3af;         /* 액센트 회색 */
}
.current-period-performance {
    margin: 15px 0;
    background: var(--dapa-surface);
    border-radius: 12px;
    box-shadow:
        0 8px 25px rgba(0,0,0,0.12),
        0 4px 10px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transform: translateZ(0);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.2);
}

.current-period-performance::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--dapa-primary), var(--dapa-primary-light));
    pointer-events: none;
}

.current-period-performance:active {
    transform: translateY(2px) scale(0.98);
    box-shadow:
        0 4px 15px rgba(0,0,0,0.15),
        0 2px 5px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.performance-header {
    background: #d1d5db;
    color: #374151;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.performance-header h5 {
    margin: 0;
    font-size: 1.2em;
}

.performance-summary {
    display: flex;
    gap: 15px;
    font-size: 1.2em;
    font-weight: bold;
}

.performance-accordion {
    padding: 0;
}

.accordion-item {
    border-bottom: 1px solid var(--dapa-border);
    transition: all 0.2s ease;
    position: relative;
}

.accordion-item:active {
    background: rgba(107, 114, 128, 0.05);
    transform: scale(0.99);
}

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

.accordion-header {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
}

.accordion-header:active {
    background: #f3f4f6;
    border-left-color: var(--dapa-primary);
    box-shadow: inset 0 2px 4px rgba(107, 114, 128, 0.1);
}

.record-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.record-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.record-title {
    font-weight: bold;
    color: var(--dapa-text-primary);
    flex: 1;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.performance-accordion .record-title-small {
    font-weight: bold !important;
    color: #333 !important;
    flex: 1;
    font-size: 16px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sequence-badge {
    background: linear-gradient(135deg, var(--dapa-primary) 0%, var(--dapa-primary-dark) 100%);
    color: white;
    padding: 3px 3px;
    border-radius: 8px;
    font-size: clamp(0.9em, 2.2vw, 1.1em); /* 20% 증가: 0.75em→0.9em, 가변 크기 적용 */
    font-weight: 100;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.1);
    text-shadow: 0 1px 2px rgba(0,0,0,0.3); /* 그림자 효과 추가 */
}

.sequence-badge:active {
    transform: scale(0.95);
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

/* PV/활동 차수 뱃지 색상 구분 */
.sequence-badge.badge-pv {
    background: linear-gradient(135deg, #5B9BD5 0%, #4A8BC4 100%) !important;
    box-shadow: 0 2px 6px rgba(91, 155, 213, 0.25) !important;
}

.sequence-badge.badge-activity {
    background: linear-gradient(135deg, #70AD47 0%, #5F9C38 100%) !important;
    box-shadow: 0 2px 6px rgba(112, 173, 71, 0.25) !important;
}

.pv-value {
    font-weight: bold;
    color: var(--dapa-text-primary);
    font-size: clamp(1.2em, 3vw, 1.4em); /* 가변 크기: 작은화면에서 20% 크게 */
    text-shadow: 0 1px 3px rgba(0,0,0,0.3); /* 그림자 효과 추가 */
    transition: all 0.3s ease;
}

.record-date {
    color: var(--dapa-text-secondary);
    font-size: 0.9em;
}

.accordion-icon {
    transition: transform 0.3s ease;
    color: #999;
}

.accordion-icon.rotated {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 20px;
    background: var(--dapa-surface);
    border-top: 1px solid var(--dapa-border);
}

.record-details {
    padding: 20px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 50%, #ffffff 100%);
    border-radius: 12px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detail-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border-left: 3px solid var(--dapa-primary-light);
    margin-bottom: 6px;
}

.detail-row-full {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border-left: 3px solid var(--dapa-success);
    margin-bottom: 6px;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    padding: 4px 0;
}

.detail-row label {
    font-weight: 600;
    color: var(--dapa-text-primary);
    min-width: 80px;
    margin-right: 10px;
    font-size: clamp(1.1em, 2.5vw, 1.3em); /* 가변 크기: 작은화면에서 1.1em으로 조정 */
}

.detail-row span {
    color: var(--dapa-text-primary);
    flex: 1;
    font-weight: 500;
    font-size: clamp(1.1em, 2.5vw, 1.3em); /* 가변 크기: 작은화면에서 1.1em으로 조정 */
}

.detail-row .amount {
    color: var(--dapa-text-primary);
    font-weight: 700;
}

.detail-row .pv-amount {
    color: #e74c3c;
    font-weight: 700;
}

.detail-row-full label {
    font-weight: 600;
    color: var(--dapa-text-primary);
    min-width: 80px;
    margin-right: 10px;
    font-size: clamp(1.1em, 2.5vw, 1.3em); /* 가변 크기: 작은화면에서 1.1em으로 조정 */
}

.detail-row-full span {
    color: var(--dapa-text-primary);
    flex: 1;
    font-weight: 500;
    line-height: 1.5;
    font-size: clamp(1.1em, 2.5vw, 1.3em); /* 가변 크기: 작은화면에서 1.1em으로 조정 */
}

.file-attachments {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--dapa-text-secondary);
    transition: color 0.3s ease;
}

.file-attachments:hover {
    color: #007bff;
}

/* 파일 모달 스타일 */
.file-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.file-modal-content {
    background-color: #fff;
    border-radius: 8px;
    width: auto;
    height: auto;
    min-width: 400px;
    max-width: calc(100% - 40px); /* 패딩을 고려한 최대 너비 */
    max-height: calc(100% - 40px); /* 패딩을 고려한 최대 높이 */
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin: auto; /* 추가 중앙 정렬 보장 */
}

.file-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.file-modal-header h3 {
    margin: 0;
    color: var(--dapa-text-primary);
}

.file-modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--dapa-text-secondary);
    line-height: 1;
}

.file-modal-close:hover {
    color: #000;
}

.file-modal-body {
    padding: 20px;
    height: calc(95% - 80px); /* 헤더 높이 제외 */
    max-height: none;
    overflow-y: auto;
}

.file-item {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f9f9f9;
}

.file-item.has-image {
    flex-direction: column;
    align-items: stretch;
}

.file-item img {
    width: 100%;
    height: 60vh;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin: 0 auto 10px auto;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.file-size {
    color: var(--dapa-text-secondary);
    font-size: 0.9em;
}

.file-download {
    background: #007bff;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.file-download:hover {
    background: #0056b3;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--dapa-text-secondary);
}

/* 태블릿 크기 */
@media (max-width: 1024px) and (min-width: 769px) {
    .file-modal {
        padding: 15px;
    }

    .file-modal-content {
        width: 70%;
        height: 95%;
        max-width: calc(100% - 30px);
        max-height: calc(100% - 30px);
        margin: auto;
    }

    .file-modal-body {
        height: calc(95vh - 80px);
    }
}

/* 모바일 크기 */
@media (max-width: 768px) {
    .file-modal {
        padding: 10px;
    }

    .file-modal-content {
        width: 95%;
        height: 95vh;
        max-width: calc(100% - 20px);
        max-height: calc(100% - 20px);
        border-radius: 8px;
        margin: auto;
    }

    .file-modal-body {
        height: calc(95vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .file-item {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 20px;
    }

    .file-item img {
        width: 100%;
        height: 70vh;
        object-fit: cover;
        margin-bottom: 15px;
    }

    .file-info {
        text-align: center;
        margin-bottom: 10px;
    }
}

/* ============================================================================
   개선된 첨부파일 및 전체화면 뷰어 스타일
   ============================================================================ */

/* 개선된 첨부파일 스타일 */
.attachment-list {
    margin-top: 10px;
}

.attachment-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    transition: box-shadow 0.2s ease;
}

.attachment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.attachment-filename {
    font-weight: bold;
    margin-bottom: 5px;
    color: #495057;
}

.attachment-filesize {
    color: #6c757d;
    font-size: 0.9em;
}

.image-preview {
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.image-preview:hover {
    transform: scale(1.02);
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.2);
}

/* 전체화면 이미지 뷰어 */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-image {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: grab;
}

.fullscreen-image:active {
    cursor: grabbing;
}

/* 컨트롤 버튼들 */
.fullscreen-controls {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,0.7);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.control-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

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

/* 이미지 인덱스 표시 */
.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 10002;
    transition: color 0.2s ease, transform 0.2s ease;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-close:hover {
    color: #ffc107;
    transform: scale(1.1);
    background: rgba(0,0,0,0.7);
}

/* 반응형 디자인 개선 */
@media (max-width: 768px) {
    .fullscreen-close {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }

    .attachment-item {
        margin-bottom: 20px;
        padding: 12px;
    }

    .attachment-filename {
        font-size: 0.9em;
    }

    .image-preview {
        height: 250px !important;
    }
}

.action-buttons {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: row;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
}

.action-buttons .btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.8em !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    min-width: 60px;
    font-weight: 500;
    line-height: 1.2;
    flex: 1;
    white-space: nowrap;
}

.action-buttons .btn-edit {
    background: #667eea;
    color: white;
    font-size: 0.8em !important;
}

.action-buttons .btn-edit:hover {
    background: #5a6fd8;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* sbtn-e 클래스 스타일 */
.sbtn-e {
    display: inline-block;
    padding: 5px 10px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 크기 variants */
.sbtn-e-xxlg {
    padding: 18px 36px;
    font-size: 1.2em;
    border-radius: 12px;
}

.sbtn-e-xs {
    padding: 6px 12px;
    font-size: 0.85em;
    border-radius: 6px;
}

/* 색상 variants */
.sbtn-e-orange {
    background: linear-gradient(135deg, var(--dapa-primary) 0%, var(--dapa-primary-light) 50%, var(--dapa-primary-dark) 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sbtn-e-darkblue {
    background: linear-gradient(135deg, var(--dapa-primary-dark) 0%, var(--dapa-primary) 50%, var(--dapa-primary-light) 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sbtn-e-gray {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 50%, #6c757d 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 블록 스타일 */
.sbtn-e-block {
    width: 100%;
    display: block;
}

/* 애니메이션 효과 */
.sbtn-e::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.sbtn-e:hover::before {
    left: 100%;
}

.sbtn-e:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
    background: linear-gradient(135deg, #b8b8b8 0%, #050505 50%, #948773 100%);
}

.sbtn-e:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 펄스 애니메이션 */
.sbtn-e-orange {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(107, 114, 128, 0.4);
    }
    50% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 0 0 10px rgba(107, 114, 128, 0);
    }
}

.action-buttons .btn-delete {
    background: #ff6b6b;
    color: white;
    font-size: 0.8em !important;
}

.action-buttons .btn-delete:hover {
    background: #ff5252;
    transform: translateY(-1px);
}

.no-records {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.no-records i {
    font-size: 3em;
    margin-bottom: 15px;
    color: #ddd;
}

.no-records p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .performance-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0px;
    }

    .record-title {
        font-size: 0.9em;
    }

    .record-meta {
        gap: 8px;
    }

    .record-date {
        font-size: 0.8em;
    }

    .detail-row-group {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 6px;
    }

    .detail-row label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 4px;
        font-size: clamp(1.1em, 2.5vw, 1.3em); /* 작은화면에서 1.1em으로 조정 */
    }

    .detail-row span {
        font-size: clamp(1.1em, 2.5vw, 1.3em); /* 작은화면에서 1.1em으로 조정 */
        word-break: break-word;
    }

    .detail-row-full {
        flex-direction: column;
        gap: 8px;
    }

    .detail-row-full label {
        min-width: auto;
        margin-right: 0;
        margin-bottom: 4px;
    }

    .action-buttons {
        gap: 8px;
        flex-direction: row;
        justify-content: flex-start;
    }

    .action-buttons .btn {
        padding: 5px 8px;
        min-width: 50px;
        font-size: 0.75em !important;
        gap: 3px;
        flex: 0 0 auto;
    }

    /* 모바일에서 sbtn-e 스타일 조정 */
    .sbtn-e-xxlg {
        padding: 15px 20px;
        font-size: 1.1em;
    }

    .sbtn-e {
        font-weight: 700;
        border-radius: 10px;
    }

    /* 모바일에서 애니메이션 강도 줄이기 */
    .sbtn-e:hover {
        transform: translateY(-1px) scale(1.01);
    }

    /* 전체실적 버튼 모바일 스타일 */
    .sbtn-e-xs {
        font-size: 1.0em !important;
        padding: 2px 20px;
    }
}

/* 480px 이하 초소형 모바일 최적화 */
@media (max-width: 480px) {
    .current-period-performance {
        margin: 8px 0;
        border-radius: 8px;
    }

    .performance-header {
        padding: 5px;
    }

    .performance-header h5 {
        font-size: 1.2em;
    }

    .performance-summary {
        padding: 8px;
    }

    .performance-content {
        padding: 8px;
    }

    .performance-details {
        gap: 6px;
        margin-top: 4px;
    }

    .detail-row-group {
        grid-template-columns: 1fr 1fr; /* 480px까지 2열 유지 */
        gap: 6px;
        padding: 6px;
        margin-bottom: 4px;
    }

    .detail-row-full {
        padding: 8px;
    }

    .detail-row {
        padding: 4px 0;
    }

    .detail-row label,
    .detail-row-full label {
        min-width: 60px;
        font-size: clamp(1.1em, 2.5vw, 1.3em); /* 작은화면에서 1.1em으로 조정 */
        margin-right: 8px;
    }

    .detail-row span,
    .detail-row-full span {
        font-size: clamp(1.1em, 2.5vw, 1.3em); /* 작은화면에서 1.1em으로 조정 */
    }

    .file-modal {
        padding: 5px;
    }

    .file-modal-content {
        width: 98%;
        border-radius: 6px;
    }

    .file-modal-body {
        padding: 10px;
        height: calc(95vh - 60px);
    }

    .file-item {
        padding: 8px;
        margin-bottom: 8px;
        gap: 8px;
    }

    .action-buttons .btn {
        padding: 4px 6px;
        font-size: 0.7em !important;
        min-width: 40px;
    }

    .pv-value {
        font-size: clamp(1.3em, 4vw, 1.6em); /* 480px 이하에서 더 크게 */
        text-shadow: 0 2px 4px rgba(0,0,0,0.4); /* 더 진한 그림자 */
        color: #e74c3c; /* 모바일에서 강조색으로 변경 */
    }
}