/* 月選択セクション */
.month-selector {
    background: linear-gradient(135deg, rgba(149, 225, 211, 0.1) 0%, rgba(135, 206, 235, 0.1) 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid #95e1d3;
}

.month-selector label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.month-selector label i {
    color: #95e1d3;
    margin-right: 8px;
}

.month-select {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    font-size: 1rem;
    border: 2px solid #95e1d3;
    border-radius: 10px;
    background: white;
    color: #2c3e50;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.month-select:hover {
    border-color: #87ceeb;
    box-shadow: 0 4px 12px rgba(149, 225, 211, 0.2);
}

.month-select:focus {
    outline: none;
    border-color: #87ceeb;
    box-shadow: 0 0 0 3px rgba(149, 225, 211, 0.2);
}

.month-note {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-note i {
    color: #95e1d3;
}

/* 累計表示セクション */
.cumulative-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.auto-calc-badge {
    display: inline-block;
    background: linear-gradient(135deg, #95e1d3, #87ceeb);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 10px;
}

.cumulative-display {
    display: grid;
    gap: 30px;
}

.cumulative-block h4 {
    margin-bottom: 20px;
}

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

.cumulative-item {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #95e1d3;
}

.item-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.item-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
}

.cumulative-note {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #856404;
}

.cumulative-note i {
    margin-right: 8px;
}

/* 過去データ編集セクション */
.history-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.history-list {
    margin-top: 20px;
}

.no-history {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1rem;
}

.history-item {
    display: grid;
    grid-template-columns: 150px 1fr 180px auto;
    gap: 15px;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 4px solid #95e1d3;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.history-month {
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-month i {
    color: #95e1d3;
}

.history-summary {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

.history-date {
    font-size: 0.8rem;
    color: #999;
}

.btn-edit {
    background: linear-gradient(135deg, #95e1d3, #87ceeb);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 225, 211, 0.4);
}

/* モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: #95e1d3;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.modal-form {
    padding: 30px;
}

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

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* 現在の月表示 */
.current-month {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 10px;
}

/* レスポンシブ */
@media (max-width: 1024px) {
    .history-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .history-date {
        order: -1;
    }
    
    .btn-edit {
        justify-self: start;
    }
}

@media (max-width: 768px) {
    .cumulative-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-form {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
}
