/* pages/_admin.css */
/* 관리자 관련 페이지 통합 스타일 */

.admin-dashboard {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 24px;
    text-align: center;
}

/* 관리자 컨테이너 */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 16px;
}

.admin-header {
    margin-bottom: 24px;
    text-align: center;
}

.admin-header h1 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.admin-header p {
    color: var(--color-text-light);
}

/* 관리자 컨트롤 섹션 */
.admin-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 24px;
    gap: 20px;
}

.admin-filter-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.dashboard-back-btn {
    display: flex;
    align-items: center;
}

.dashboard-back-btn .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--color-background);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.dashboard-back-btn .btn:hover {
    background-color: var(--color-white);
    box-shadow: var(--shadow-soft);
}

.dashboard-back-btn .btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.date-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    width: 100%; /* export-options가 없으므로 전체 너비 사용 */
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 필터 스타일 */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
}

.search-box {
    position: relative;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 8px 12px;
    padding-left: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

.search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.filter-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-dropdown label {
    font-weight: 500;
    color: var(--color-text-dark);
}

.filter-select,
.board-filter select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background-color: #fff;
    font-size: 0.95rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* KPI 섹션 스타일 */
.kpi-section,
.revenue-section,
.member-analysis-section,
.marketing-section {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 10px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.kpi-card {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.kpi-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
}

.revenue-icon {
    background-color: rgba(59, 130, 246, 0.1);
}

.members-icon {
    background-color: rgba(16, 185, 129, 0.1);
}

.tests-icon {
    background-color: rgba(245, 158, 11, 0.1);
}

.arpu-icon {
    background-color: rgba(168, 85, 247, 0.1);
}

.kpi-content {
    flex-grow: 1;
}

.kpi-title {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 4px;
}

.kpi-trend {
    font-size: 0.85rem;
}

.kpi-trend.positive {
    color: var(--color-success);
}

.kpi-trend.negative {
    color: var(--color-error);
}

/* _admin.css 파일에 추가 */
.member-analysis-section .tab-content {
    display: none;
    /* 이 부분이 중요: 탭 콘텐츠가 숨겨져 있어도 차트가 렌더링될 수 있도록 */
    position: relative;
    height: auto;
    min-height: 300px;
    width: 100%;
}

.member-analysis-section .tab-content.active {
    display: block;
}

/* 차트 컨테이너 */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-bottom: 24px;
}

.pie-chart-container {
    height: 200px;
    position: relative;
}

/* 매출 분석 섹션 */
.revenue-breakdown {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.breakdown-item {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    padding: 20px;
}

.breakdown-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 16px;
}

/* 회원 분석 섹션 */
.analysis-tabs {
    display: flex;
    margin-bottom: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 8px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--color-text-light);
    position: relative;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

.tab-btn:hover {
    color: var(--color-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    font-weight: 600;
}

.tab-btn.active::after {
    background-color: var(--color-primary);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.metric-card {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.metric-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.retention-cohort {
    margin-top: 24px;
}

.retention-cohort h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 16px;
}

/* 마케팅 성과 섹션 */
.marketing-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.marketing-card {
    background-color: var(--color-background);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.marketing-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.marketing-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 16px;
}

/* 관리자 탭 네비게이션 */
.admin-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--color-border);
}

.admin-navigation .nav-item {
    background: none;
    border: none;
    padding: 12px 24px;
    margin: 0 8px;
    color: var(--color-text-light);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.admin-navigation .nav-item:hover {
    color: var(--color-primary);
}

.admin-navigation .nav-item.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* 관리자 탭 콘텐츠 영역 스타일 */
.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 카드 스타일 */
.admin-card {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-soft);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 테이블 컨테이너 */
.table-container {
    overflow-x: auto;
    margin-bottom: var(--spacing-lg);
}

/* 데이터 테이블 */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 16px;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background-color: var(--color-background);
    font-weight: 600;
    color: var(--color-text-dark);
    position: relative;
}

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

.data-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* 정렬 가능한 열 */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 24px;
}

.sortable::after {
    content: "↕";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    font-size: 0.8rem;
}

.sortable.sort-asc::after {
    content: "↑";
    color: var(--color-primary);
}

.sortable.sort-desc::after {
    content: "↓";
    color: var(--color-primary);
}

/* 테이블 푸터 */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background-color: var(--color-background);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.total-count {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.pagination {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-page {
    background: none;
    border: 1px solid var(--color-border);
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-page:hover:not(:disabled) {
    background-color: var(--color-background);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 게시판 관리 특화 스타일 */
.board-filter {
    min-width: 150px;
}

.post-title {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 테이블 내 액션 버튼 */
.action-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.action-btn:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.action-btn.danger {
    color: var(--color-error);
}

.action-btn.danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* 상태 뱃지 */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.status-expiring {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.status-expired {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-group .input-hint {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* 게시글 에디터 폼 */
.editor-form textarea {
    min-height: 200px;
    font-family: inherit;
}

/* 버튼 스타일 재정의 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
}

.btn-primary:hover {
    background-color: #2563EB;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-text-dark);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-background);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

/* 반응형 디자인 */
@media (max-width: 1200px) {

    .kpi-grid,
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .revenue-breakdown,
    .marketing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-filter-section {
        margin-bottom: 24px;
    }

    .date-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-actions {
        margin-top: 16px;
        width: 100%;
        flex-wrap: wrap;
    }

    .search-box {
        flex-grow: 1;
    }

    .admin-navigation {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {

    .kpi-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        flex-direction: column;
        text-align: center;
    }

    .kpi-icon {
        margin: 0 auto;
    }

    .analysis-tabs {
        flex-wrap: wrap;
    }

    .date-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group label {
        margin-bottom: 4px;
    }

    .card-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .board-filter {
        width: 100%;
    }

    .table-footer {
        flex-direction: column;
        gap: 12px;
    }
}

/* ===== admin.css에 추가할 실데이터 대시보드 스타일 ===== */

/* 🔥 실데이터 대시보드 전용 스타일 */
.dashboard-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #F3F4F6;
    border-top: 4px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dashboard-error-message {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border: 1px solid #F87171;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    color: #991B1B;
}

.error-content h3 {
    margin: 0 0 0.5rem 0;
    color: #DC2626;
}

.error-content p {
    margin: 0 0 1rem 0;
    color: #7F1D1D;
}

/* 데이터 상태 표시 */
.data-status-section {
    margin-bottom: 1.5rem;
}

.data-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6B7280;
    padding: 0.75rem 1rem;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    flex-shrink: 0;
}

.status-indicator.loading {
    background: #F59E0B;
    animation: pulse 1.5s infinite;
}

.status-indicator.error {
    background: #EF4444;
}

.last-update-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: #9CA3AF;
}

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

/* KPI 카드 개선 */
.kpi-card {
    position: relative;
    overflow: hidden;
}

.kpi-card.loading {
    opacity: 0.6;
}

.kpi-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 테이블 스타일 개선 */
.even-row {
    background-color: #F9FAFB;
}

.odd-row {
    background-color: white;
}

.amount-cell, .number-cell {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.total-cell {
    border-left: 2px solid #E5E7EB;
    font-weight: 600;
}

.high-performance {
    background-color: #D1FAE5 !important;
}

.medium-performance {
    background-color: #FEF3C7 !important;
}

.low-performance {
    background-color: #FEE2E2 !important;
}

.excellent-rate, .excellent-roi {
    color: #059669;
    font-weight: 600;
}

.good-rate, .good-roi {
    color: #0D9488;
    font-weight: 500;
}

.average-rate, .average-roi {
    color: #D97706;
}

.poor-rate, .poor-roi {
    color: #DC2626;
}

/* 새로고침 버튼 스타일 */
.refresh-btn {
    background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.refresh-btn .refresh-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

.refresh-btn.refreshing .refresh-icon {
    animation: spin 1s linear infinite;
}

/* 대시보드 컨트롤 레이아웃 */
.admin-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* 필터 및 내보내기 컨트롤 */
.admin-filter-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.export-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.export-controls .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

/* 차트 컨테이너 개선 */
.chart-container {
    position: relative;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.chart-container.loading {
    opacity: 0.6;
}

.chart-container.loading::before {
    content: '차트 로딩 중...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #6B7280;
    font-size: 0.875rem;
    z-index: 10;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 데이터 없음 상태 */
.no-data-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #6B7280;
}

.no-data-message svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* 요약 카드 스타일 */
.data-summary-section {
    margin-bottom: 2rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.summary-card h4 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F3F4F6;
}

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

.summary-item .label {
    color: #6B7280;
    font-size: 0.875rem;
}

.summary-item .value {
    color: #1F2937;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* 알림 애니메이션 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 차트 특별 스타일 */
.pie-chart-container {
    position: relative;
    height: 300px;
    padding: 1rem;
}

.breakdown-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.breakdown-item h3 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

/* 테이블 반응형 개선 */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background: #F9FAFB;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #E5E7EB;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
}

.data-table tr:hover {
    background-color: #F9FAFB;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .admin-filter-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .export-controls {
        justify-content: center;
    }
    
    .revenue-breakdown,
    .marketing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-loading-overlay {
        padding: 1rem;
    }
    
    .loading-spinner {
        padding: 1.5rem;
    }
    
    .error-content {
        text-align: center;
    }
    
    .data-status {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .last-update-time {
        margin-left: 0;
        width: 100%;
        text-align: center;
        margin-top: 0.25rem;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .export-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .export-controls .btn {
        width: 100%;
    }
    
    .admin-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .dashboard-controls {
        justify-content: center;
    }
    
    .date-filters {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .filter-select,
    .filter-date {
        width: 100%;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        padding: 0.5rem;
    }
    
    .breakdown-item {
        padding: 0.5rem;
    }
    
    .pie-chart-container {
        height: 250px;
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .summary-card {
        padding: 1rem;
    }
    
    .summary-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .summary-item .value {
        font-size: 1.1rem;
    }
    
    .kpi-card {
        padding: 1rem;
    }
    
    .kpi-value {
        font-size: 1.5rem !important;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

/* 접근성 개선 */
.status-indicator {
    position: relative;
}

.status-indicator::after {
    content: attr(aria-label);
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #1F2937;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.status-indicator:hover::after,
.status-indicator:focus::after {
    opacity: 1;
}

/* 포커스 스타일 개선 */
.refresh-btn:focus,
.btn:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
}

.filter-select:focus,
.filter-date:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 0;
    border-color: #3B82F6;
}

/* 스크롤바 스타일링 */
.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* 성능 최적화를 위한 will-change 속성 */
.kpi-card.loading::after,
.refresh-btn.refreshing .refresh-icon {
    will-change: transform;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .status-indicator {
        border: 2px solid currentColor;
    }
    
    .kpi-card,
    .summary-card,
    .chart-container {
        border-width: 2px;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* 모션 감소 설정 지원 */
@media (prefers-reduced-motion: reduce) {
    .spinner,
    .refresh-btn.refreshing .refresh-icon,
    .kpi-card.loading::after {
        animation: none;
    }
    
    .status-indicator.loading {
        animation: none;
        background: #F59E0B;
    }
    
    .summary-card:hover {
        transform: none;
    }
    
    .refresh-btn:hover {
        transform: none;
    }
}

/* 인쇄 스타일 */
@media print {
    .dashboard-loading-overlay,
    .refresh-btn,
    .export-controls,
    .admin-controls {
        display: none;
    }
    
    .summary-cards,
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .summary-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.25rem;
    }
}

/* 사용자 삭제 관련 CSS 스타일 */

/* 삭제 확인 모달 스타일 */
.delete-confirmation-content {
    padding: 1rem;
}

.warning-section {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.warning-title {
    color: #dc2626;
    margin: 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.warning-message {
    color: #7f1d1d;
    margin: 0;
    line-height: 1.5;
}

.user-info-section {
    margin-bottom: 1.5rem;
}

.user-detail-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 500;
    color: #374151;
    min-width: 80px;
}

.info-value {
    color: #1f2937;
    text-align: right;
}

.subscription-status.active {
    color: #059669;
    font-weight: 500;
}

.subscription-status.expired {
    color: #dc2626;
    font-weight: 500;
}

.deletion-options {
    margin-bottom: 1.5rem;
}

.option-group h4 {
    margin: 0 0 1rem 0;
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
}

.checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 0.75rem;
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.checkbox-option label {
    color: #374151;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.deletion-note {
    margin-bottom: 1.5rem;
}

.deletion-note label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.deletion-note textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
}

.deletion-note textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.recovery-info {
    margin-top: 1rem;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
}

.info-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.info-text {
    color: #1e40af;
    font-size: 0.875rem;
    line-height: 1.5;
}

.info-text strong {
    color: #1d4ed8;
}

/* 삭제 버튼 스타일 */
.action-btn.delete-user {
    background-color: #dc3545 !important;
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn.delete-user:hover {
    background-color: #c82333 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

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

/* 모달 버튼 스타일 */
.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

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

.btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

/* 상태 배지 스타일 개선 */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.status-expired {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.status-expiring {
    background-color: #fef3c7;
    color: #92400e;
}

/* 테이블 행 호버 효과 */
.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.data-table tbody tr:hover .action-btn {
    opacity: 1;
    transform: scale(1.02);
}

/* 액션 버튼 컨테이너 */
.data-table td:last-child {
    white-space: nowrap;
}

.action-btn {
    opacity: 0.8;
    transition: all 0.2s ease;
    margin-right: 0.25rem;
}

.action-btn:last-child {
    margin-right: 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .delete-confirmation-content {
        padding: 0.75rem;
    }
    
    .warning-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .warning-icon {
        font-size: 2.5rem;
    }
    
    .user-detail-card {
        padding: 0.75rem;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .info-value {
        text-align: left;
    }
    
    .action-btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        margin-bottom: 0.25rem;
    }
}

/* 로딩 상태 */
.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.action-btn.loading {
    position: relative;
    color: transparent;
}

.action-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 쿠폰 관리 CSS 스타일 */

/* 쿠폰 통계 카드 */
.coupon-stats-section {
    margin-bottom: 2rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1;
}

.stat-trend {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0.25rem 0 0 0;
}

/* 쿠폰 테이블 스타일 */
.coupon-code-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coupon-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.copy-code-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.copy-code-btn:hover {
    opacity: 1;
}

.coupon-type-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.usage-progress {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.usage-text {
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
}

.usage-bar {
    width: 60px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.3s ease;
}

.no-expiry {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.85rem;
}

.action-buttons {
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: #f3f4f6;
}

/* 쿠폰 필터 */
.coupon-filters {
    display: flex;
    gap: 0.5rem;
}

.coupon-filters select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #111827;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

/* 폼 스타일 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.duration-input-group {
    display: flex;
    gap: 0.5rem;
}

.duration-input-group input {
    flex: 2;
}

.duration-input-group select {
    flex: 1;
}

/* 대량 생성 미리보기 */
.bulk-preview {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.bulk-preview h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: #374151;
}

.preview-content {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.preview-summary {
    margin-bottom: 1rem;
}

.preview-summary p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.preview-example h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.example-coupon {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 6px;
}

.example-code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-weight: 600;
    color: #667eea;
}

.example-desc {
    font-size: 0.875rem;
    color: #6b7280;
}

.preview-placeholder {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    margin: 2rem 0;
}

/* 사용 내역 테이블 */
.granted-subscription {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.subscription-type {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.subscription-duration {
    font-size: 0.75rem;
    color: #6b7280;
}

/* 상태 배지 */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.status-expired {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.status-disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .coupon-filters {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .action-buttons {
        justify-content: center;
    }
}