* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

header h1 {
    font-size: 2em;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dashboard {
    padding: 30px;
}

section {
    margin-bottom: 40px;
}

/* 월별 선택 섹션 */
.month-selector {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.month-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.month-controls h2 {
    font-size: 1.8em;
    color: #333;
    min-width: 200px;
    text-align: center;
}

.btn-icon {
    background: white;
    border: 2px solid #667eea;
    color: #667eea;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

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

.comparison-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.comparison-card.current {
    border: 3px solid #667eea;
    transform: scale(1.05);
}

.comparison-card .label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.comparison-card .amount {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.comparison-card .change {
    font-size: 0.9em;
    font-weight: 600;
}

.change.positive {
    color: #28a745;
}

.change.negative {
    color: #dc3545;
}

/* 카테고리별 요약 카드 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    padding: 25px;
    border-radius: 15px;
    color: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.summary-card.category-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.summary-card.category-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card.category-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-card h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    opacity: 0.9;
}

.amount-large {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
}

.percentage {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 차트 섹션 */
.chart-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.chart-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    height: 400px;
    position: relative;
}

/* 테이블 섹션 */
.table-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.table-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

tbody tr:hover {
    background: #f8f9fa;
}

.no-data {
    text-align: center;
    color: #999;
    padding: 40px !important;
}

/* 보고서 섹션 */
.report-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
}

.report-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

#reportText {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

#reportText:focus {
    outline: none;
    border-color: #667eea;
}

/* 링크 공유 모달 */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 99999 !important;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 25px;
}

.share-url-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.share-url-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9em;
    font-family: monospace;
    background: #f8f9fa;
}

.share-url-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.btn-copy {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-copy:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.copy-success {
    padding: 10px;
    background: #d4edda;
    color: #155724;
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    margin-top: 10px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    padding: 10px 20px;
    min-width: 100px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    header h1 {
        font-size: 1.5em;
    }

    .month-controls h2 {
        font-size: 1.3em;
        min-width: auto;
    }

    .chart-container {
        height: 300px;
    }

    .amount-large {
        font-size: 1.8em;
    }

    .comparison-cards {
        grid-template-columns: 1fr;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .share-url-container {
        flex-direction: column;
    }

    .btn-copy {
        width: 100%;
    }
}

